Open sionescu opened 2 years ago
Weird.
If a thread is marked to be destroyed, then a Java error (not an exception) is eventually thrown. That should unwind the stack and therefore should execute unwind-protect
cleanup forms.
Are these defined to behave like Java finally
? Unwinding the Java stack should cause the finally
forms between the Java throw and the Java catch to be executed.
A solution that should always work, but that would change the architecture of destroying threads, would be to implement destroying a thread via interrupting it with (lambda () (throw '%abcl-destroy-thread nil))
after wrapping all thread code in (catch '%abcl-destroy-thread ...)
- if CL throws and catches work fine, then this should also work fine.
It looks like
THREADS:DESTROY-THREAD
does not evaluate cleanup forms, but simply terminates the thread.Test case:
On all Lisps that I can get my hands on, the equivalent code in Bordeaux-Threads returns :SUCCESS, while ABCL returns :ENTERED.