Compare commits
No commits in common. "8100d36aa5bebb6c6fab114ae5595ace2be43b2e" and "04d964a9f8ce007ed2fc53f47eca6435c83973b9" have entirely different histories.
8100d36aa5
...
04d964a9f8
1 changed files with 13 additions and 17 deletions
|
|
@ -558,9 +558,8 @@
|
|||
(lambda (exn)
|
||||
;; This can happen if the resource pool is destroyed very
|
||||
;; quickly
|
||||
(if (resource-pool-destroyed-error? exn)
|
||||
#f
|
||||
(raise-exception exn)))
|
||||
(unless (resource-pool-destroyed-error? exn)
|
||||
(raise-exception exn)))
|
||||
(lambda ()
|
||||
(with-parallelism-limiter
|
||||
return-new-resource/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))))
|
||||
(hash-ref resources
|
||||
resource-id)))
|
||||
available))
|
||||
|
||||
;; Do this in parallel to avoid deadlocks between the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue