Added thread-yield

This commit is contained in:
Justin Ethier 2015-12-19 23:44:39 -05:00
parent 5e4ab77f33
commit 72e3a2e91b

View file

@ -1,12 +1,14 @@
(define-library (scheme base) (define-library (scheme base)
(export (export
;; Thread functions. these are not standard, and may be relocated ;; Thread functions. these are not standard, and may be relocated
;; TODO: relocate to (scheme srfi 18) or such
thread? thread?
make-thread make-thread
thread-name thread-name
thread-specific thread-specific
thread-specific-set! thread-specific-set!
thread-start! thread-start!
thread-yield!
;; END threads ;; END threads
; TODO: need filter for the next two. also, they really belong in SRFI-1, not here ; TODO: need filter for the next two. also, they really belong in SRFI-1, not here
;delete ;delete
@ -681,4 +683,7 @@
(let* ((thunk (vector-ref t 1)) (let* ((thunk (vector-ref t 1))
(mutator-id (Cyc-spawn-thread! thunk))) (mutator-id (Cyc-spawn-thread! thunk)))
(vector-set! t 2 mutator-id))) (vector-set! t 2 mutator-id)))
(define (thread-yield!) (thread-sleep! 1))
;; TODO: thread-terminate!
;; TODO: thread-join!
)) ))