0.8.6.5
[sbcl.git] / src / code / target-unithread.lisp
index c684a3c..fde8f13 100644 (file)
@@ -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
 
      (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
@@ -115,10 +122,9 @@ time we reacquire LOCK and return to the caller."
   (signal-queue-head queue))
 
 
-;;;; multiple independent listeners
-
-(defvar *session-lock* nil)
-
 ;;;; job control
 
 (defun debugger-wait-until-foreground-thread (stream) t)
+(defun get-foreground () t)
+(defun release-foreground (&optional next) t)
+