Closed eshelyaron closed 2 months ago
thread_exit/1 is deprecated as it may deadlock the system when called if the receiving thread holds a lock. The currect way to kill a thread is
( catch(thread_signal(TID, abort), error(_,_), fail)
-> thread_join(TID, _)
; true
).
Hi,
In Sweep, we have so far been using
thread_signal(T, thread_exit(0))
to kill top-level threads. With SWI-Prolog 9.3.10 (and possibly a couple of versions before that), this yields a crash with the following backtrace:Replacing
thread_exit/1
withthrow/1
seems to circumvent this issue, so I'll perform such a change in Sweep, but I thought I'd report this anyway for visibility.Also, when trying to debug this crash I stumbled into another crash in
initGMP
during Sweep initialization. I used the following workaround, but I'm not familiar enough with these areas to be sure it's the right solution: