3 ms·
Ah, the eternal problem of asynch unwind! (without-interrupts (acquire-resource) (unwind-protect (with-local-interrupts (do-jobs-m
by kscarlet 1y ago
Ah, the eternal problem of asynch unwind!
(without-interrupts
(acquire-resource)
(unwind-protect
(with-local-interrupts
(do-jobs-might-block-or-whatever))
(release-resource)))
... and to cancel:
(interrupt-thread thread (lambda () (abort-thread)))
I think what is really needed is just exception (unwind cleanup) mechanism and a cheap way to mask interrupts. Signal deferral mechanism does exactly that -- so that with(out)-interrupts just simply set a variable and don't need to go through syscall.