From 3114dbf890dc304916d30c06895f55022b839a85 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Tue, 29 Apr 2003 00:28:42 +0000 Subject: [PATCH] 0.pre8.118 Fix WITH-MUTEX bug: don't release the mutex if we didn't manage to acquire it in the first place --- src/code/target-thread.lisp | 13 +++++++------ version.lisp-expr | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/code/target-thread.lisp b/src/code/target-thread.lisp index 0a9ab3b..18b278e 100644 --- a/src/code/target-thread.lisp +++ b/src/code/target-thread.lisp @@ -140,12 +140,13 @@ (setf old-value t1)))) (defmacro with-mutex ((mutex &key value (wait-p t)) &body body) - (let ((block (gensym "NIL"))) - `(unwind-protect - (block ,block - (unless (get-mutex ,mutex ,value ,wait-p) (return-from ,block nil)) - ,@body) - (release-mutex ,mutex)))) + (let ((block (gensym "NIL")) + (got (gensym "GOT"))) + `(let ((,got (get-mutex ,mutex ,value ,wait-p))) + (when ,got + (unwind-protect + (progn ,@body) + (release-mutex ,mutex)))))) ;;;; condition variables diff --git a/version.lisp-expr b/version.lisp-expr index 5eed17a..4f8fa0d 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.pre8.117" +"0.pre8.118" -- 1.7.10.4