Skip to content

Commit

Permalink
Merge 'sverker/26/erts/halt-race-fix/OTP-19490'
Browse files Browse the repository at this point in the history
into sverker/27/erts/halt-race-fix/OTP-19490
  • Loading branch information
sverker committed Feb 13, 2025
2 parents 5e883a9 + c066990 commit 12c312f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions erts/emulator/beam/bif.c
Original file line number Diff line number Diff line change
Expand Up @@ -4055,6 +4055,10 @@ BIF_RETTYPE halt_2(BIF_ALIST_2)
("System halted by BIF halt(%T, %T)\n", BIF_ARG_1, BIF_ARG_2));
if (flush) {
erts_halt(pos_int_code, halt_flush_timeout);
/* We lost race against other halt call.
Suspend this process and do a dummy trap while waiting
for other halt call to terminate the beam. */
erts_suspend(BIF_P, ERTS_PROC_LOCK_MAIN, NULL);
ERTS_BIF_YIELD2(BIF_TRAP_EXPORT(BIF_halt_2), BIF_P, am_undefined, am_undefined);
}
else {
Expand Down

0 comments on commit 12c312f

Please sign in to comment.