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