Compare commits

..

No commits in common. "8100d36aa5bebb6c6fab114ae5595ace2be43b2e" and "04d964a9f8ce007ed2fc53f47eca6435c83973b9" have entirely different histories.

View file

@ -558,8 +558,7 @@
(lambda (exn)
;; This can happen if the resource pool is destroyed very
;; quickly
(if (resource-pool-destroyed-error? exn)
#f
(unless (resource-pool-destroyed-error? exn)
(raise-exception exn)))
(lambda ()
(with-parallelism-limiter
@ -589,11 +588,13 @@
#:unwind? #t)))))
#:unwind? #t))))
(define (spawn-fiber-to-destroy-resource resource-id resource-value)
(define (spawn-fiber-to-destroy-resource resource-id resource-details)
(spawn-fiber
(lambda ()
(let loop ()
(let* ((success?
(let* ((resource
(resource-details-value resource-details))
(success?
(with-exception-handler
(lambda _ #f)
(lambda ()
@ -607,7 +608,7 @@
(print-backtrace-and-exception/knots exn)
(raise-exception exn))
(lambda ()
(start-stack #t (destructor resource-value))
(start-stack #t (destructor resource))
#t)))
#:unwind? #t)))
@ -661,8 +662,7 @@
destructor)
(spawn-fiber-to-destroy-resource
resource-id
(resource-details-value
(hash-ref resources resource-id))))
(hash-ref resources resource-id)))
(hash-remove! resources resource-id)
@ -886,8 +886,7 @@
lifetime))
(begin
(spawn-fiber-to-destroy-resource resource-id
(resource-details-value
resource-details))
resource-details)
(loop next-resource-id
available
waiters))
@ -957,8 +956,7 @@
(hash-ref resources
resource-id)))
(spawn-fiber-to-destroy-resource resource-id
(resource-details-value
resource-details))
resource-details)
(loop next-resource-id
available
@ -1035,8 +1033,7 @@
(lambda (resource-id)
(spawn-fiber-to-destroy-resource
resource-id
(resource-details-value
(hash-ref resources resource-id))))
(hash-ref resources resource-id)))
resources-to-destroy))
(loop next-resource-id
@ -1075,9 +1072,8 @@
(lambda (resource-id)
(spawn-fiber-to-destroy-resource
resource-id
(resource-details-value
(hash-ref resources
resource-id))))
resource-id)))
available))
;; Do this in parallel to avoid deadlocks between the