projects
/
sbcl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
don't stack-allocate specialized vectors on non-conservtive control stacks
[sbcl.git]
/
src
/
code
/
thread.lisp
diff --git
a/src/code/thread.lisp
b/src/code/thread.lisp
index
c471fc9
..
a780b16
100644
(file)
--- a/
src/code/thread.lisp
+++ b/
src/code/thread.lisp
@@
-107,15
+107,22
@@
stale value, use MUTEX-OWNER instead."
'progn
'with-local-interrupts)))
`(let* ((,thread *current-thread*)
'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)
(flet ((exec () ,@body))
(if ,prev
(,without
(unwind-protect
(progn
(setf (thread-waiting-for ,thread) nil)
+ (barrier (:write))
(,with (exec)))
(,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))
(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)
(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))))
(without-gcing
(funcall function))))