mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-16 09:02:22 -07:00
extend task system with thread count, so usage code can easily create per-thread state; pass thread idx into task entry points
This commit is contained in:
@@ -49,6 +49,15 @@ ts_init(void)
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Top-Level Accessors
|
||||
|
||||
internal U64
|
||||
ts_thread_count(void)
|
||||
{
|
||||
return ts_shared->task_threads_count;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: High-Level Task Kickoff / Joining
|
||||
|
||||
@@ -190,7 +199,7 @@ ts_task_thread__entry_point(void *p)
|
||||
}
|
||||
|
||||
//- rjf: run task
|
||||
void *task_result = task_function(task_arena, task_params);
|
||||
void *task_result = task_function(task_arena, thread_idx, task_params);
|
||||
|
||||
//- rjf: store into artifact
|
||||
U64 artifact_num = task_ticket.u64[0];
|
||||
|
||||
Reference in New Issue
Block a user