From 1c05958c9c7c4d0b7d0b30c91dddae5998ca767d Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Tue, 07 Oct 2014 14:03:08 -0400 Subject: mutex_is_unlockable(): New function --- 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${$}" ] +} -- cgit v0.9.1