diff --git a/scheduler.rkt b/scheduler.rkt index c456854..68b8c64 100644 --- a/scheduler.rkt +++ b/scheduler.rkt @@ -1,7 +1,8 @@ #lang racket/base (require racket/async-channel - racket/match) + racket/match + "version.rkt") ;; Scheduler manages a list of asynchronous and cancellable tasks for each document. ;; For each document, a task is uniquely identified by its key. @@ -24,7 +25,10 @@ (define th (hash-ref doc type)) (unless (thread-dead? th) (kill-thread th))) - (hash-set! doc type (thread task))))) + (hash-set! doc type + (if (version>=9.0?) + (thread #:pool 'own task) + (thread task)))))) (loop))) (define _scheduler (thread schedule)) diff --git a/version.rkt b/version.rkt new file mode 100644 index 0000000..f9bb680 --- /dev/null +++ b/version.rkt @@ -0,0 +1,12 @@ +#lang racket + +(provide version>=9.0?) + +(require version/utils) + +(define (version>=? target-version) + (not (version=9.0?) + (version>=? "9.0")) +