Index: srfi-18.scm =================================================================== --- srfi-18.scm (revision 13178) +++ srfi-18.scm (working copy) @@ -188,7 +188,7 @@ (##sys#slot th 8) ) (define-inline (%thread-mutexes-set! th wt) - (##sys#setslot th 8 wx) ) + (##sys#setslot th 8 wt) ) (define-inline (%thread-mutexes-empty? th) (null? (%thread-mutexes th)) ) @@ -399,7 +399,7 @@ (max 0 (+ s C_startup_time_seconds)) ) (define-inline (%seconds->milliseconds s) - (* (##sys#flonum-fraction (##sys#exact->inexact s)) 1000) ) + (* s 1000) ) (define-inline (%milliseconds->seconds ms) (/ ms 1000) ) @@ -473,17 +473,19 @@ (set! make-thread (lambda (thunk #!optional (name (gensym 'thread))) (##sys#check-closure thunk 'make-thread) - (%make-thread - name - (lambda () - (##sys#call-with-values - thunk - (lambda results - (%thread-results-set! thread results) - (##sys#thread-kill! thread 'dead) - (##sys#schedule))))))) ) + (let ((thread (%make-thread name #f))) + (%thread-thunk-set! + thread + (lambda () + (##sys#call-with-values + thunk + (lambda results + (%thread-results-set! thread results) + (##sys#thread-kill! thread 'dead) + (##sys#schedule))))) + thread))) ) -(define (thread? x) (%thread x)) +(define (thread? x) (%thread? x)) (define (current-thread) ##sys#current-thread) @@ -611,7 +613,7 @@ (lambda (#!optional (id (gensym 'mutex))) (%make-mutex id) ) ) ) -(define (mutex? x) (%mutex x)) +(define (mutex? x) (%mutex? x)) (define (mutex-name mutex) (%check-mutex mutex 'mutex-specific)