Permalink
Browse files

Attempt to prevent bad state in case lock acquisition fails.

  • Loading branch information...
Shinmera committed Apr 9, 2018
1 parent f27a284 commit 2b755181d3bd762578ac49b84d394f95dcf7bd2b
Showing with 4 additions and 3 deletions.
  1. +4 −3 context.lisp
@@ -124,9 +124,10 @@
(bt:with-lock-held ((context-wait-lock context))
(incf (context-waiting context))
(v:info :trial.context "~a waiting to acquire ~a (~a in queue)..." this context (context-waiting context)))
(bt:acquire-lock (context-lock context))
(bt:with-lock-held ((context-wait-lock context))
(decf (context-waiting context))))
(unwind-protect
(bt:acquire-lock (context-lock context))
(bt:with-lock-held ((context-wait-lock context))
(decf (context-waiting context)))))
(T
(bt:acquire-lock (context-lock context))))
(unless (valid-p context)

0 comments on commit 2b75518

Please sign in to comment.