projects
/
sbcl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
0.8.3.6:
[sbcl.git]
/
src
/
code
/
target-unithread.lisp
diff --git
a/src/code/target-unithread.lisp
b/src/code/target-unithread.lisp
index
e7a1917
..
e11ec9d
100644
(file)
--- a/
src/code/target-unithread.lisp
+++ b/
src/code/target-unithread.lisp
@@
-1,14
+1,15
@@
(in-package "SB!THREAD")
(in-package "SB!THREAD")
-#-sb-fluid (declaim (inline sb!vm::current-thread-offset-sap))
+;;; used bu debug-int.lisp to access interrupt contexts
+#!-sb-fluid (declaim (inline sb!vm::current-thread-offset-sap))
(defun sb!vm::current-thread-offset-sap (n)
(declare (type (unsigned-byte 27) n))
(sb!sys:sap-ref-sap (alien-sap (extern-alien "all_threads" (* t)))
(* n 4)))
(defun current-thread-id ()
(defun sb!vm::current-thread-offset-sap (n)
(declare (type (unsigned-byte 27) n))
(sb!sys:sap-ref-sap (alien-sap (extern-alien "all_threads" (* t)))
(* n 4)))
(defun current-thread-id ()
- (sb!sys:sap-int
- (sb!vm::current-thread-offset-sap sb!vm::thread-pid-slot)))
+ (sb!sys:sap-ref-32 (alien-sap (extern-alien "all_threads" (* t)))
+ (* sb!vm::thread-pid-slot 4)))
;;;; queues, locks
;;;; queues, locks
@@
-90,8
+91,15
@@
(setf old-value t1))))
(defmacro with-mutex ((mutex &key value (wait-p t)) &body body)
(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
;;; what's the best thing to do with these on unithread?
#+NIl