Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/signals-unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ static int thread0_exit_signo = 0;
static void JL_NORETURN jl_exit_thread0_cb(void)
{
CFI_NORETURN
jl_atomic_fetch_add(&jl_gc_disable_counter, -1);
jl_critical_error(thread0_exit_signo, 0, NULL, jl_current_task);
jl_atexit_hook(128);
jl_raise(thread0_exit_signo);
Expand Down Expand Up @@ -963,6 +964,12 @@ static void *signal_listener(void *arg)
//#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 199309L && !HAVE_KEVENT
// si_code = info.si_code;
//#endif
// Let's forbid threads from running GC while we're trying to exit,
// also let's make sure we're not in the middle of GC.
jl_atomic_fetch_add(&jl_gc_disable_counter, 1);
while (jl_atomic_load_acquire(&jl_gc_running)) {
jl_cpu_pause();
}
jl_exit_thread0(sig, bt_data, bt_size);
}
else if (critical) {
Expand Down