don't check for a timeout on thread-join! unless one was specified

This commit is contained in:
Alex Shinn 2012-07-21 18:46:56 +09:00
parent fd87e62ec0
commit a3daf9f728

View file

@ -14,12 +14,12 @@
(define thread-yield! yield!)
(define (thread-join! thread . o)
(let ((timeout (if (pair? o) (car o) #f)))
(let ((timeout (and (pair? o) (car o))))
(cond
((%thread-join! thread (timeout->seconds timeout)))
(else
(thread-yield!)
(if (thread-timeout?)
(if (and timeout (thread-timeout?))
(if (and (pair? o) (pair? (cdr o)))
(cadr o)
(error "timed out waiting for thread" thread))