Permalink
Browse files

0.pre8.118

	Fix WITH-MUTEX bug: don't release the mutex if we didn't
	manage to acquire it in the first place
  • Loading branch information...
1 parent 3d3ac32 commit 3114dbf890dc304916d30c06895f55022b839a85 @telent telent committed Apr 29, 2003
Showing with 8 additions and 7 deletions.
  1. +7 −6 src/code/target-thread.lisp
  2. +1 −1 version.lisp-expr
@@ -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
View
@@ -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"

0 comments on commit 3114dbf

Please sign in to comment.