only enable priority thread running on initial run loop; do not pay the cost every run loop iteration

This commit is contained in:
Ryan Fleury
2025-09-15 17:18:59 -07:00
parent 2a8ca37cb3
commit 1b82c52803
+5 -2
View File
@@ -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);