Change how spawn-fiber-to-destroy-resource is used
And fix a couple of incorrect uses.
This commit is contained in:
parent
04d964a9f8
commit
9cce89fc01
1 changed files with 14 additions and 11 deletions
|
|
@ -588,13 +588,11 @@
|
|||
#:unwind? #t)))))
|
||||
#:unwind? #t))))
|
||||
|
||||
(define (spawn-fiber-to-destroy-resource resource-id resource-details)
|
||||
(define (spawn-fiber-to-destroy-resource resource-id resource-value)
|
||||
(spawn-fiber
|
||||
(lambda ()
|
||||
(let loop ()
|
||||
(let* ((resource
|
||||
(resource-details-value resource-details))
|
||||
(success?
|
||||
(let* ((success?
|
||||
(with-exception-handler
|
||||
(lambda _ #f)
|
||||
(lambda ()
|
||||
|
|
@ -608,7 +606,7 @@
|
|||
(print-backtrace-and-exception/knots exn)
|
||||
(raise-exception exn))
|
||||
(lambda ()
|
||||
(start-stack #t (destructor resource))
|
||||
(start-stack #t (destructor resource-value))
|
||||
#t)))
|
||||
#:unwind? #t)))
|
||||
|
||||
|
|
@ -662,7 +660,8 @@
|
|||
destructor)
|
||||
(spawn-fiber-to-destroy-resource
|
||||
resource-id
|
||||
(hash-ref resources resource-id)))
|
||||
(resource-details-value
|
||||
(hash-ref resources resource-id))))
|
||||
|
||||
(hash-remove! resources resource-id)
|
||||
|
||||
|
|
@ -886,7 +885,8 @@
|
|||
lifetime))
|
||||
(begin
|
||||
(spawn-fiber-to-destroy-resource resource-id
|
||||
resource-details)
|
||||
(resource-details-value
|
||||
resource-details))
|
||||
(loop next-resource-id
|
||||
available
|
||||
waiters))
|
||||
|
|
@ -956,7 +956,8 @@
|
|||
(hash-ref resources
|
||||
resource-id)))
|
||||
(spawn-fiber-to-destroy-resource resource-id
|
||||
resource-details)
|
||||
(resource-details-value
|
||||
resource-details))
|
||||
|
||||
(loop next-resource-id
|
||||
available
|
||||
|
|
@ -1033,7 +1034,8 @@
|
|||
(lambda (resource-id)
|
||||
(spawn-fiber-to-destroy-resource
|
||||
resource-id
|
||||
(hash-ref resources resource-id)))
|
||||
(resource-details-value
|
||||
(hash-ref resources resource-id))))
|
||||
resources-to-destroy))
|
||||
|
||||
(loop next-resource-id
|
||||
|
|
@ -1072,8 +1074,9 @@
|
|||
(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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue