We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bbb0596 commit 6be4221Copy full SHA for 6be4221
src/signals-unix.c
@@ -1033,6 +1033,12 @@ static void *signal_listener(void *arg)
1033
}
1034
#endif
1035
if (doexit) {
1036
+ // Let's forbid threads from running GC while we're trying to exit,
1037
+ // also let's make sure we're not in the middle of GC.
1038
+ jl_atomic_fetch_add(&jl_gc_disable_counter, 1);
1039
+ while (jl_atomic_load_acquire(&jl_gc_running)) {
1040
+ jl_cpu_pause();
1041
+ }
1042
// The exit can get stuck if it happens at an unfortunate spot in thread 0
1043
// (unavoidable due to its async nature).
1044
// Try much harder to exit next time, if we get multiple exit requests.
0 commit comments