From b8a4e0535f962e79ac99c1f10d5aa41ec788046f Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sun, 29 Dec 2019 11:33:32 -0600 Subject: [PATCH] thread: small simplification in scheduler --- racket/src/cs/rumble/control.ss | 2 +- racket/src/thread/schedule.rkt | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/racket/src/cs/rumble/control.ss b/racket/src/cs/rumble/control.ss index 1880a9b41bf..0890f7d2a5a 100644 --- a/racket/src/cs/rumble/control.ss +++ b/racket/src/cs/rumble/control.ss @@ -108,7 +108,7 @@ mark-chain ; #f or a cached list of mark-chain-frame or elem+cache traces ; #f or a cached list of traces cc-guard ; for impersonated tag, initially #f - avail-cache)) ; cache for `continuation-pompt-available?` + avail-cache)) ; cache for `continuation-prompt-available?` ;; Messages to `resume-k[/no-wind]`: (define-record aborting (args)) diff --git a/racket/src/thread/schedule.rkt b/racket/src/thread/schedule.rkt index 2964abcf0ec..96092e6c214 100644 --- a/racket/src/thread/schedule.rkt +++ b/racket/src/thread/schedule.rkt @@ -119,8 +119,7 @@ (current-thread/in-atomic t) (set-place-current-thread! current-place t) (set! thread-swap-count (add1 thread-swap-count)) - (run-callbacks-in-engine e callbacks t leftover-ticks - swap-in-engine)) + (run-callbacks-in-engine e callbacks t leftover-ticks)) (define (swap-in-engine e t leftover-ticks) (let loop ([e e]) @@ -212,9 +211,9 @@ ;; Run callbacks within the thread for `e`, and don't give up until ;; the callbacks are done -(define (run-callbacks-in-engine e callbacks t leftover-ticks k) +(define (run-callbacks-in-engine e callbacks t leftover-ticks) (cond - [(null? callbacks) (k e t leftover-ticks)] + [(null? callbacks) (swap-in-engine e t leftover-ticks)] [else (define done? #f) (let loop ([e e]) @@ -230,7 +229,7 @@ (unless e (internal-error "thread ended while it should run callbacks atomically")) (if done? - (k e t leftover-ticks) + (swap-in-engine e t leftover-ticks) (loop e)))))])) ;; Run foreign "async-apply" callbacks, now that we're in some thread