summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2014-10-07 14:03:08 (EDT)
committer P. J. McDermott <pj@pehjota.net>2014-10-07 14:03:08 (EDT)
commit1c05958c9c7c4d0b7d0b30c91dddae5998ca767d (patch)
tree02c1f9438babc17cae30aadec4583c5e1a9f2149 /lib
parentdea2e9719dbc7b855292e227696497d8a893193b (diff)
mutex_is_unlockable(): New function
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${$}" ]
+}