(declaim (inline waitqueue-data-address mutex-value-address))
(defstruct waitqueue
- (name nil :type (or null simple-base-string))
+ (name nil :type (or null simple-string))
(lock 0)
(data nil))
;; in time we'll move some of the binding presently done in C
;; here too
(let ((sb!kernel::*restart-clusters* nil)
+ (sb!kernel::*handler-clusters* nil)
+ (sb!kernel::*condition-restarts* nil)
(sb!impl::*descriptor-handlers* nil) ; serve-event
(sb!impl::*available-buffers* nil)) ;for fd-stream
;; can't use handling-end-of-the-world, because that flushes
;; output streams, and we don't necessarily have any (or we
;; could be sharing them)
(sb!sys:enable-interrupt sb!unix:sigint :ignore)
- (sb!unix:unix-exit
- (catch 'sb!impl::%end-of-the-world
- (with-simple-restart
- (destroy-thread
- (format nil "~~@<Destroy this thread (~A)~~@:>"
- (current-thread-id)))
- (funcall real-function))
- 0))))))))
+ (catch 'sb!impl::%end-of-the-world
+ (with-simple-restart
+ (destroy-thread
+ (format nil "~~@<Destroy this thread (~A)~~@:>"
+ (current-thread-id)))
+ (funcall real-function))
+ 0))
+ (values))))))
(with-mutex ((session-lock *session*))
(pushnew tid (session-threads *session*)))
tid))
"Call FUNCTION once for each known thread, giving it the thread structure as argument"
(let ((function (coerce function 'function)))
(loop for thread = (alien-sap (extern-alien "all_threads" (* t)))
- then (sb!sys:sap-ref-sap thread (* 4 sb!vm::thread-next-slot))
+ then (sb!sys:sap-ref-sap thread (* sb!vm:n-word-bytes
+ sb!vm::thread-next-slot))
until (sb!sys:sap= thread (sb!sys:int-sap 0))
collect (funcall function thread))))
(let ((thread (alien-sap (extern-alien "all_threads" (* t)))))
(loop
(when (sb!sys:sap= thread (sb!sys:int-sap 0)) (return nil))
- (let ((pid (sb!sys:sap-ref-32 thread (* 4 sb!vm::thread-pid-slot))))
+ (let ((pid (sb!sys:sap-ref-32 thread (* sb!vm:n-word-bytes
+ sb!vm::thread-pid-slot))))
(when (= pid id) (return thread))
- (setf thread (sb!sys:sap-ref-sap thread (* 4 sb!vm::thread-next-slot)))))))
+ (setf thread (sb!sys:sap-ref-sap thread (* sb!vm:n-word-bytes
+ sb!vm::thread-next-slot)))))))
;;; internal use only. If you think you need to use this, either you
;;; are an SBCL developer, are doing something that you should discuss
(let ((thread (thread-sap-from-id thread-id)))
(when thread
(let* ((index (sb!vm::symbol-tls-index symbol))
- (tl-val (sb!sys:sap-ref-32 thread (* 4 index))))
+ (tl-val (sb!sys:sap-ref-word thread
+ (* sb!vm:n-word-bytes index))))
(if (eql tl-val sb!vm::unbound-marker-widetag)
(sb!vm::symbol-global-value symbol)
(sb!kernel:make-lisp-obj tl-val))))))