Please sign in to comment.
Use explicit pausing around fork() for signal handler and finalizer
This prevents deadlocks in situations where fork() is called from multiple threads. The problem is that it keeps spawning and killing threads that causes deadlocks in for example starting the thread in Thread::in_new_thread when the thread becomes GC dependent. The tricky interaction here between GC dependent and the worker_lock makes this solution much easier. We now define explicit pause points where it's fine that we can fork because these auxiliary threads aren't running any code at that point. These with all previous commits fixes #2138. This issues not only exposed the thread safety issue with the C-API constants but also caused the deadlocks that this commit and previous changes to the signal handler fixes.
- Loading branch information...
Showing with 66 additions and 23 deletions.