summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/mutex.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/mutex.sh b/lib/mutex.sh
index 5fd6b70..00333a2 100644
--- a/lib/mutex.sh
+++ b/lib/mutex.sh
@@ -48,3 +48,10 @@ mutex_unlock()
rm "${mutex}"
}
+
+mutex_is_unlockable()
+{
+ local mutex="${1}"
+
+ [ "x$(cat "${mutex}" 2>/dev/null)" = "x${$}" ]
+}