From e808e8e467554708bc54058d244a014e4a5d4b71 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Tue, 07 Oct 2014 14:03:21 -0400 Subject: session_end(): Don't lock mutex if we have it --- (limited to 'lib') 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 -- cgit v0.9.1