Fix a bug where resources pools could empty with waiters

This commit is contained in:
Christopher Baines 2025-11-17 11:18:23 +00:00
parent 40b64e269b
commit a13098494d
2 changed files with 21 additions and 0 deletions

View file

@ -939,6 +939,10 @@
(eq? x resource))
resources)))
(when (and (not (q-empty? waiters))
(< (- (length resources) 1)
max-size))
(spawn-fiber-to-return-new-resource))
(loop (if index
(remove-at-index! resources index)