mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-05 21:38:40 +00:00
first pass at setting up base layer async thread path
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
global U64 global_update_tick_idx = 0;
|
||||
global CondVar async_tick_cond_var = {0};
|
||||
global Mutex async_tick_mutex = {0};
|
||||
|
||||
internal void
|
||||
main_thread_base_entry_point(int arguments_count, char **arguments)
|
||||
@@ -9,6 +11,10 @@ main_thread_base_entry_point(int arguments_count, char **arguments)
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
ThreadNameF("[main thread]");
|
||||
|
||||
//- rjf: set up async thread group info
|
||||
async_tick_cond_var = cond_var_alloc();
|
||||
async_tick_mutex = mutex_alloc();
|
||||
|
||||
//- rjf: set up telemetry
|
||||
#if PROFILE_TELEMETRY
|
||||
local_persist char tm_data[MB(64)];
|
||||
@@ -133,3 +139,15 @@ update(void)
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
internal void
|
||||
async_thread_entry_point(void *params)
|
||||
{
|
||||
MutexScope(async_tick_mutex) for(;;)
|
||||
{
|
||||
cond_var_wait(async_tick_cond_var, async_tick_mutex, max_U64);
|
||||
#if defined(FILE_STREAM_H)
|
||||
fs_async_tick();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user