mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-04 04:48:40 +00:00
provide mechanism to not wait at top of async loop
This commit is contained in:
@@ -6,7 +6,7 @@ global CondVar async_tick_start_cond_var = {0};
|
|||||||
global CondVar async_tick_stop_cond_var = {0};
|
global CondVar async_tick_stop_cond_var = {0};
|
||||||
global Mutex async_tick_start_mutex = {0};
|
global Mutex async_tick_start_mutex = {0};
|
||||||
global Mutex async_tick_stop_mutex = {0};
|
global Mutex async_tick_stop_mutex = {0};
|
||||||
global U64 async_wait_timeout = 0;
|
global B32 async_loop_again = 0;
|
||||||
global B32 global_async_exit = 0;
|
global B32 global_async_exit = 0;
|
||||||
|
|
||||||
internal void
|
internal void
|
||||||
@@ -190,7 +190,14 @@ async_thread_entry_point(void *params)
|
|||||||
ThreadNameF("async_thread_%I64u", lane_idx());
|
ThreadNameF("async_thread_%I64u", lane_idx());
|
||||||
for(;!ins_atomic_u32_eval(&global_async_exit);)
|
for(;!ins_atomic_u32_eval(&global_async_exit);)
|
||||||
{
|
{
|
||||||
MutexScope(async_tick_start_mutex) cond_var_wait(async_tick_start_cond_var, async_tick_start_mutex, os_now_microseconds()+100000);
|
if(!ins_atomic_u32_eval(&async_loop_again))
|
||||||
|
{
|
||||||
|
MutexScope(async_tick_start_mutex) cond_var_wait(async_tick_start_cond_var, async_tick_start_mutex, os_now_microseconds()+100000);
|
||||||
|
if(lane_idx() == 0)
|
||||||
|
{
|
||||||
|
async_loop_again = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
#if defined(CONTENT_H)
|
#if defined(CONTENT_H)
|
||||||
c_tick();
|
c_tick();
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -728,6 +728,7 @@ dasm_tick(void)
|
|||||||
req_n->v.hash = hash;
|
req_n->v.hash = hash;
|
||||||
req_n->v.params = params;
|
req_n->v.params = params;
|
||||||
req_n->v.params.dbgi_key = di_key_copy(dasm_shared->req_arena, &req_n->v.params.dbgi_key);
|
req_n->v.params.dbgi_key = di_key_copy(dasm_shared->req_arena, &req_n->v.params.dbgi_key);
|
||||||
|
ins_atomic_u32_eval_assign(&async_loop_again, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
di_scope_close(di_scope);
|
di_scope_close(di_scope);
|
||||||
|
|||||||
Reference in New Issue
Block a user