Add call-with-default-io-waiters

As this is useful when starting threads from a fibers context.
This commit is contained in:
Christopher Baines 2024-10-31 16:44:15 +00:00
parent 55af7c82e8
commit 2d7100e75d

View file

@ -52,6 +52,7 @@
with-resource-from-pool with-resource-from-pool
resource-pool-stats resource-pool-stats
call-with-default-io-waiters
make-worker-thread-channel make-worker-thread-channel
%worker-thread-default-timeout %worker-thread-default-timeout
call-with-worker-thread call-with-worker-thread
@ -497,6 +498,14 @@ available. Return the resource once PROC has returned."
(raise-exception (raise-exception
(make-resource-pool-timeout-error)))))) (make-resource-pool-timeout-error))))))
(define (call-with-default-io-waiters thunk)
(parameterize
((current-read-waiter (@@ (ice-9 suspendable-ports)
default-read-waiter))
(current-write-waiter (@@ (ice-9 suspendable-ports)
default-write-waiter)))
(thunk)))
(define %worker-thread-args (define %worker-thread-args
(make-parameter #f)) (make-parameter #f))