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-yield! yield!)
(define (thread-join! thread . o) (define (thread-join! thread . o)
(let ((timeout (if (pair? o) (car o) #f))) (let ((timeout (and (pair? o) (car o))))
(cond (cond
((%thread-join! thread (timeout->seconds timeout))) ((%thread-join! thread (timeout->seconds timeout)))
(else (else
(thread-yield!) (thread-yield!)
(if (thread-timeout?) (if (and timeout (thread-timeout?))
(if (and (pair? o) (pair? (cdr o))) (if (and (pair? o) (pair? (cdr o)))
(cadr o) (cadr o)
(error "timed out waiting for thread" thread)) (error "timed out waiting for thread" thread))