summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/session.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/session.sh b/lib/session.sh
index 64954b5..a2d18e3 100644
--- a/lib/session.sh
+++ b/lib/session.sh
@@ -94,8 +94,11 @@ session_end()
rmdir "${session_root}/prokit/sessions/${session_id}/wd"
rmdir "${session_root}/prokit/sessions/${session_id}"
- if ! mutex_lock_timeout "${session_root}/prokit/sessions.lock" 5; then
- error 2 "$(get_msg 'cant_lock_sessions')"
+ if ! mutex_is_unlockable "${session_root}/prokit/sessions.lock"; then
+ if ! mutex_lock_timeout "${session_root}/prokit/sessions.lock" 5
+ then
+ error 2 "$(get_msg 'cant_lock_sessions')"
+ fi
fi
# Clear the sessions pool. If there are no more sessions, unmount the