From 72e3a2e91bac50b60c4faf2030136f21d4f13ceb Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Sat, 19 Dec 2015 23:44:39 -0500 Subject: [PATCH] Added thread-yield --- scheme/base.sld | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scheme/base.sld b/scheme/base.sld index 840debbd..c368ec58 100644 --- a/scheme/base.sld +++ b/scheme/base.sld @@ -1,12 +1,14 @@ (define-library (scheme base) (export ;; Thread functions. these are not standard, and may be relocated + ;; TODO: relocate to (scheme srfi 18) or such thread? make-thread thread-name thread-specific thread-specific-set! thread-start! + thread-yield! ;; END threads ; TODO: need filter for the next two. also, they really belong in SRFI-1, not here ;delete @@ -681,4 +683,7 @@ (let* ((thunk (vector-ref t 1)) (mutator-id (Cyc-spawn-thread! thunk))) (vector-set! t 2 mutator-id))) + (define (thread-yield!) (thread-sleep! 1)) + ;; TODO: thread-terminate! + ;; TODO: thread-join! ))