Add more exception handling to make-resource-pool

As I'm not sure it's working reliably.
This commit is contained in:
Christopher Baines 2023-11-17 12:32:14 +00:00
parent da2a405e8b
commit b2bf948a00

View file

@ -98,6 +98,15 @@
(let ((channel (make-channel))) (let ((channel (make-channel)))
(spawn-fiber (spawn-fiber
(lambda ()
(while #t
(with-exception-handler
(lambda (exn)
(simple-format
(current-error-port)
"exception in the ~A pool fiber: ~A\n"
name
exn))
(lambda () (lambda ()
(let loop ((resources '()) (let loop ((resources '())
(available '()) (available '())
@ -186,7 +195,8 @@
unknown) unknown)
(loop resources (loop resources
available available
waiters)))))) waiters)))))
#:unwind? #t))))
channel)) channel))