projects
/
mit-scheme.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
deee9dd
)
Block interrupts, _then_ lock.
author
Taylor R Campbell
<campbell@mumble.net>
Wed, 29 May 2019 04:24:40 +0000
(
04:24
+0000)
committer
Taylor R Campbell
<campbell@mumble.net>
Wed, 29 May 2019 05:01:25 +0000
(
05:01
+0000)
Otherwise an interrupt might try to acquire the lock while we already
hold it, leading to deadlock.
(cherry picked from commit
9a3417ac7a5f294fbbda397086d890029d45343a
)
src/runtime/gcfinal.scm
patch
|
blob
|
history
diff --git
a/src/runtime/gcfinal.scm
b/src/runtime/gcfinal.scm
index 8bee6bc698cfdf6510997393008e23c0f5f8aac1..34437313706c720f9e5de32e921630a38189ca76 100644
(file)
--- a/
src/runtime/gcfinal.scm
+++ b/
src/runtime/gcfinal.scm
@@
-111,10
+111,10
@@
USA.
(loop (cdr items) items))))))
(define (with-finalizer-lock finalizer thunk)
- (with
-thread-mutex-lock
-
(gc-finalizer-mutex finalizer
)
-
(lambda (
)
-
(without-interruption
thunk))))
+ (with
out-interruption
+
(lambda (
)
+
(with-thread-mutex-lock (gc-finalizer-mutex finalizer
)
+ thunk))))
(define (with-gc-finalizer-lock finalizer thunk)
(guarantee-gc-finalizer finalizer 'with-gc-finalizer-lock)