X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Ftarget-unithread.lisp;h=e11ec9d3eb188d17b4e920b55101bcfb700ec42a;hb=02c9007b4ca5753406f60019f4fe5e5f8392541a;hp=c684a3c32be8bbbc10c78f76fa4e4b10d7814adf;hpb=ce3d6da896e35c9e202db443c5cfc9fedcf65ebe;p=sbcl.git diff --git a/src/code/target-unithread.lisp b/src/code/target-unithread.lisp index c684a3c..e11ec9d 100644 --- a/src/code/target-unithread.lisp +++ b/src/code/target-unithread.lisp @@ -91,8 +91,15 @@ (setf old-value t1)))) (defmacro with-mutex ((mutex &key value (wait-p t)) &body body) - (declare (ignore mutex value wait-p)) - `(progn ,@body)) + (cond ((not wait-p) + `(unless (mutex-value ,mutex) + (unwind-protect + (progn + (setf (mutex-value ,mutex) (or ,value t)) + ,@body) + (setf (mutex-value ,mutex) nil)))) + (t + `(progn ,@body)))) ;;; what's the best thing to do with these on unithread? #+NIl