Commit 3114dbf8 authored by Daniel Barlow's avatar Daniel Barlow
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
parent 3d3ac32d
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -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"