mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-13 07:32:23 -07:00
fix call stack flickering; do not timeout early if we need to fall back to stale results after requesting new call stack compute
This commit is contained in:
@@ -3426,7 +3426,7 @@ ctrl_call_stack_from_thread(CTRL_Scope *scope, CTRL_EntityCtx *entity_ctx, CTRL_
|
||||
//- rjf: loop: try to grab cached call stack; request; wait
|
||||
//
|
||||
B32 can_request = !ins_atomic_u64_eval(&ctrl_state->ctrl_thread_run_state);
|
||||
for(;;)
|
||||
for(U64 retry_idx = 0;; retry_idx += 1)
|
||||
{
|
||||
//- rjf: [read-only] try to look for current call stack; wait if working
|
||||
B32 node_exists = 0;
|
||||
@@ -3462,6 +3462,12 @@ ctrl_call_stack_from_thread(CTRL_Scope *scope, CTRL_EntityCtx *entity_ctx, CTRL_
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: out of time => exit
|
||||
if(retry_idx > 0 && os_now_microseconds() >= endt_us)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
//- rjf: [write] node does not exist => create; request if new or stale
|
||||
B32 need_request = (!node_exists || node_stale);
|
||||
CTRL_CallStackCacheNode *node_to_request = 0;
|
||||
@@ -3501,12 +3507,6 @@ ctrl_call_stack_from_thread(CTRL_Scope *scope, CTRL_EntityCtx *entity_ctx, CTRL_
|
||||
node_to_request->working_count -= 1;
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: out of time => exit
|
||||
if(os_now_microseconds() >= endt_us)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return call_stack;
|
||||
|
||||
Reference in New Issue
Block a user