Skip to content

Commit bccddb0

Browse files
author
ArnavKapoor
committed
Fix: use jl_atomic_load_relaxed for jl_signal_thread for thread safety
1 parent 6d3e664 commit bccddb0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ static void restore_fp_env(void)
557557
if (jl_set_zero_subnormals(0) || jl_set_default_nans(0)) {
558558
jl_error("Failed to configure floating point environment");
559559
}
560-
if (!jl_options.handle_signals && jl_n_threads > 1) {
560+
if (!jl_options.handle_signals && jl_atomic_load_relaxed(&jl_n_threads) > 1) {
561561
jl_error("Cannot use `--handle-signals=no` with multiple threads (JULIA_NUM_THREADS > 1).\n"
562562
"This will cause segmentation faults due to GC safepoint failures.\n"
563563
"Remove `--handle-signals=no` or set JULIA_NUM_THREADS=1.\n"

0 commit comments

Comments
 (0)