From fe3d09b2061b66acef8a3c3309bad27e176da379 Mon Sep 17 00:00:00 2001 From: Jan Moringen Date: Sun, 15 Nov 2015 13:16:22 +0100 Subject: [PATCH] Fix commit "WAIT-ON-SEMAPHORE could block indefinitely ..." commit (aa0389fa) The commit broke builds without :SB-THREAD feature by defining %CONDITION-WAIT in a way that uses thing only available in :SB-THREAD builds. --- src/code/target-thread.lisp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/code/target-thread.lisp b/src/code/target-thread.lisp index ad4e96279..9eb654191 100644 --- a/src/code/target-thread.lisp +++ b/src/code/target-thread.lisp @@ -836,13 +836,19 @@ IF-NOT-OWNER is :FORCE)." :slot token) (declaim (inline %condition-wait)) -(defun %condition-wait (queue mutex timeout to-sec to-usec stop-sec stop-usec deadlinep) +(defun %condition-wait (queue mutex + timeout to-sec to-usec stop-sec stop-usec deadlinep) + #!-sb-thread + (declare (ignore queue mutex to-sec to-usec stop-sec stop-usec deadlinep)) + #!-sb-thread + (sb!ext:wait-for nil :timeout timeout) ; Yeah... + #!+sb-thread (let ((me *current-thread*)) (barrier (:read)) (assert (eq me (mutex-%owner mutex))) (let ((status :interrupted)) - ;; Need to disable interrupts so that we don't miss grabbing the - ;; mutex on our way out. + ;; Need to disable interrupts so that we don't miss grabbing + ;; the mutex on our way out. (without-interrupts (unwind-protect (progn @@ -977,12 +983,7 @@ around the call, checking the the associated data: (push data *data*) (condition-notify *queue*))) " - #!-sb-thread - (declare (ignore queue)) (assert mutex) - #!-sb-thread - (sb!ext:wait-for nil :timeout timeout) ; Yeah... - #!+sb-thread (locally (declare (inline %condition-wait)) (multiple-value-bind (to-sec to-usec stop-sec stop-usec deadlinep) (decode-timeout timeout) -- 2.11.4.GIT