mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-11-20 13:10:07 -08:00
thread broadcast
This commit is contained in:
1 parent
ef712a36e7
commit
e9ac0abdf9
2 files changed
+16
No files matched your search
@@ -245,3 +245,17 @@ tp_divide_work(Arena *arena, U64 item_count, U32 worker_count)
|
||||
|
||||
return range_arr;
|
||||
}
|
||||
|
||||
internal void *
|
||||
tp_broadcast_(TP_Context *tp, U64 task_id, void *ptr)
|
||||
{
|
||||
if (task_id == 0) {
|
||||
tp->broadcast = ptr;
|
||||
}
|
||||
barrier_wait(tp->barrier);
|
||||
|
||||
void *result = tp->broadcast;
|
||||
barrier_wait(tp->barrier);
|
||||
|
||||
return result;
|
||||
}
|
||||
Reference in new issue
Block a user