X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fthread.lisp;h=a780b16887ad4e72fd9c14f2465f7946233be14d;hb=a00ea11a89c9db677e60edf6832c905a4527b5cb;hp=4d6a83cfa3bb1bbcccff2b816a80718e8fcd782a;hpb=7bb4c044e09f02a2115095af3733b0673b98a726;p=sbcl.git diff --git a/src/code/thread.lisp b/src/code/thread.lisp index 4d6a83c..a780b16 100644 --- a/src/code/thread.lisp +++ b/src/code/thread.lisp @@ -118,8 +118,11 @@ stale value, use MUTEX-OWNER instead." (setf (thread-waiting-for ,thread) nil) (barrier (:write)) (,with (exec))) - (setf (thread-waiting-for ,thread) ,prev) - (barrier (:write)))) + ;; If we were waiting on a waitqueue, this becomes a bogus + ;; wakeup. + (when (mutex-p ,prev) + (setf (thread-waiting-for ,thread) ,prev) + (barrier (:write))))) (exec))))))) (sb!xc:defmacro with-mutex ((mutex &key (value '*current-thread*) (wait-p t))