From: Christopher Allan Webber Date: Sat, 10 Dec 2016 03:03:47 +0000 (-0600) Subject: agenda: Add yield procedure. X-Git-Tag: v0.3.0~26 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=15ef27631b1f1fe71fdc77c8da1196d7604cfdac;p=8sync.git agenda: Add yield procedure. * 8sync/agenda.scm (yield): New variable. --- diff --git a/8sync/agenda.scm b/8sync/agenda.scm index e5b5160..b14f7b1 100644 --- a/8sync/agenda.scm +++ b/8sync/agenda.scm @@ -545,6 +545,13 @@ forge ahead in our current function!" (define-syntax-rule (8sleep time) (8sync-delay 'no-op time)) +;; Voluntarily yield execution +(define (yield) ; @@: should this be define-inlinable? + "Voluntarily yield execution to the scheduler." + (8sync-abort-to-prompt + (make-async-request + (lambda (kont) + (make-run-request (lambda () (kont #f)) #f))))) ;;; Execution of agenda, and current agenda