X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Ftarget-unithread.lisp;h=651573d43c8078f10af34fd63ff804b58046ba27;hb=240b0db303764545c982e9362a986243b535f7f4;hp=c684a3c32be8bbbc10c78f76fa4e4b10d7814adf;hpb=34dcb46f78a01d543756703d7ccdf3d999a134d0;p=sbcl.git diff --git a/src/code/target-unithread.lisp b/src/code/target-unithread.lisp index c684a3c..651573d 100644 --- a/src/code/target-unithread.lisp +++ b/src/code/target-unithread.lisp @@ -56,7 +56,7 @@ (let ((h (car (waitqueue-data queue)))) (setf (waitqueue-lock queue) 0) (when h - (sb!unix:unix-kill h :sigcont))))) + (sb!unix:unix-kill h sb!unix:sigcont))))) ;;;; mutex @@ -91,11 +91,20 @@ (setf old-value t1)))) (defmacro with-mutex ((mutex &key value (wait-p t)) &body body) - (declare (ignore mutex value wait-p)) - `(progn ,@body)) - -;;; what's the best thing to do with these on unithread? -#+NIl + (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? commented +;;; functions are the thread versions, just to remind me what they do +;;; there +#+nil (defun condition-wait (queue lock) "Atomically release LOCK and enqueue ourselves on QUEUE. Another thread may subsequently notify us using CONDITION-NOTIFY, at which @@ -114,11 +123,12 @@ time we reacquire LOCK and return to the caller." "Notify one of the processes waiting on QUEUE" (signal-queue-head queue)) - -;;;; multiple independent listeners - -(defvar *session-lock* nil) +(defun maybe-install-futex-functions () nil) ;;;; job control +(defun init-job-control () t) (defun debugger-wait-until-foreground-thread (stream) t) +(defun get-foreground () t) +(defun release-foreground (&optional next) t) +(defun terminate-session ())