Skip to content

Commit

Permalink
Debug race condition issue
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Guyot <[email protected]>
  • Loading branch information
pguyot committed Dec 24, 2024
1 parent f186dc1 commit 2529011
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/libAtomVM/opcodesswitch.h
Original file line number Diff line number Diff line change
Expand Up @@ -2551,14 +2551,11 @@ HOT_FUNC int scheduler_entry_point(GlobalContext *glb)
}

if (needs_to_wait) {
ctx->saved_ip = saved_pc;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
ctx->restore_trap_handler = &&wait_timeout_trap_handler;
#pragma GCC diagnostic pop
ctx->saved_module = mod;
ctx = scheduler_wait(ctx);
goto schedule_in;
SCHEDULE_WAIT(mod, saved_pc);
}
#endif

Expand Down Expand Up @@ -2592,6 +2589,7 @@ HOT_FUNC int scheduler_entry_point(GlobalContext *glb)
if (UNLIKELY(!mailbox_has_next(&ctx->mailbox))) {
// No message is here.
// We were signaled for another reason.
printf("%s:%d -- ctx->process_id = %d\n", __FILE__, __LINE__, ctx->process_id);
ctx = scheduler_wait(ctx);
goto schedule_in;
} else {
Expand Down Expand Up @@ -3182,10 +3180,7 @@ HOT_FUNC int scheduler_entry_point(GlobalContext *glb)
if (LIKELY(remaining_reductions)) {
JUMP_TO_ADDRESS(mod->labels[label]);
} else {
ctx->saved_ip = mod->labels[label];
ctx->saved_module = mod;
ctx = scheduler_next(ctx->global, ctx);
goto schedule_in;
SCHEDULE_NEXT(mod, mod->labels[label]);
}
#endif
break;
Expand Down Expand Up @@ -6383,7 +6378,7 @@ HOT_FUNC int scheduler_entry_point(GlobalContext *glb)
case OP_RECV_MARKER_CLEAR: {
DEST_REGISTER(reg_a);
DECODE_DEST_REGISTER(reg_a, pc);
TRACE("recv_marker_clean/1: reg1=%c%i\n", T_DEST_REG(reg_a));
TRACE("recv_marker_clear/1: reg1=%c%i\n", T_DEST_REG(reg_a));
break;
}

Expand Down

0 comments on commit 2529011

Please sign in to comment.