X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fthread.lisp;h=a780b16887ad4e72fd9c14f2465f7946233be14d;hb=a00ea11a89c9db677e60edf6832c905a4527b5cb;hp=71dc92b03de6e0491ea334508da2500395c1328c;hpb=b56c1a4dc22aa0ac827343667584aa6090b15f02;p=sbcl.git diff --git a/src/code/thread.lisp b/src/code/thread.lisp index 71dc92b..a780b16 100644 --- a/src/code/thread.lisp +++ b/src/code/thread.lisp @@ -73,7 +73,7 @@ stale value, use MUTEX-OWNER instead." (define-deprecated-function :early "1.0.53.11" make-spinlock make-mutex (&key name) (make-mutex :name name)) -(define-deprecated-function :early "1.0.5.x" spinlock-name mutex-name (lock) +(define-deprecated-function :early "1.0.53.11" spinlock-name mutex-name (lock) (mutex-name lock)) (define-deprecated-function :early "1.0.53.11" (setf spinlock-name) (setf mutex-name) (name lock) @@ -107,15 +107,22 @@ stale value, use MUTEX-OWNER instead." 'progn 'with-local-interrupts))) `(let* ((,thread *current-thread*) - (,prev (thread-waiting-for ,thread))) + (,prev (progn + (barrier (:read)) + (thread-waiting-for ,thread)))) (flet ((exec () ,@body)) (if ,prev (,without (unwind-protect (progn (setf (thread-waiting-for ,thread) nil) + (barrier (:write)) (,with (exec))) - (setf (thread-waiting-for ,thread) ,prev))) + ;; 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)) @@ -207,7 +214,7 @@ provided the default value is used for the mutex." (funcall function))) (defun call-with-recursive-system-lock/without-gcing (function mutex) - (declare (function function) (ignore lock)) + (declare (function function) (ignore mutex)) (without-gcing (funcall function))))