From 15ef27631b1f1fe71fdc77c8da1196d7604cfdac Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Fri, 9 Dec 2016 21:03:47 -0600 Subject: [PATCH] agenda: Add yield procedure. * 8sync/agenda.scm (yield): New variable. --- 8sync/agenda.scm | 7 +++++++ 1 file changed, 7 insertions(+) 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 -- 2.31.1