diff --git a/src/ctrl/ctrl_core.c b/src/ctrl/ctrl_core.c index 07f828fb..b9b51256 100644 --- a/src/ctrl/ctrl_core.c +++ b/src/ctrl/ctrl_core.c @@ -5930,7 +5930,7 @@ ctrl_thread__run(DMN_CtrlCtx *ctrl_ctx, CTRL_Msg *msg) B32 spoof_mode = 0; CTRL_Spoof spoof = {0}; DMN_TrapChunkList entry_traps = {0}; - for(;;) + for(U64 run_loop_idx = 0;; run_loop_idx += 1) { ////////////////////////// //- rjf: choose low level traps @@ -5954,7 +5954,10 @@ ctrl_thread__run(DMN_CtrlCtx *ctrl_ctx, CTRL_Msg *msg) //- rjf: setup run controls // DMN_RunCtrls run_ctrls = {0}; - run_ctrls.priority_thread = target_thread.dmn_handle; + if(run_loop_idx == 0) + { + run_ctrls.priority_thread = target_thread.dmn_handle; + } run_ctrls.ignore_previous_exception = 1; run_ctrls.run_entity_count = frozen_threads.count; run_ctrls.run_entities = push_array(scratch.arena, DMN_Handle, run_ctrls.run_entity_count);