MCPcopy Create free account
hub / github.com/cameron314/concurrentqueue / ForEachArena

Function ForEachArena

benchmarks/tbb/task_group_context.cpp:390–402  ·  view source on GitHub ↗

Propagate to all master threads (under my_arenas_list_mutex lock)

Source from the content-addressed store, hash-verified

388 }
389 // Propagate to all master threads (under my_arenas_list_mutex lock)
390 ForEachArena(a) { // uses lock on my_arenas_list_mutex
391 arena_slot &slot = a.my_slots[0];
392 generic_scheduler *s = slot.my_scheduler;
393 // If the master is under construction, skip it. Otherwise make sure that it does not
394 // leave its arena and its scheduler get destroyed while we accessing its data.
395 if ( s && as_atomic(slot.my_scheduler).compare_and_swap(LockedMaster, s) == s ) { //TODO: remove need in lock
396 __TBB_ASSERT( slot.my_scheduler == LockedMaster, NULL );
397 // The whole propagation sequence is locked, thus no contention is expected
398 __TBB_ASSERT( s != LockedMaster, NULL );
399 s->propagate_task_group_state( mptr_state, src, new_state );
400 __TBB_store_with_release( slot.my_scheduler, s );
401 }
402 } EndForEach();
403 return true;
404}
405

Callers

nothing calls this directly

Calls 3

__TBB_store_with_releaseFunction · 0.85
compare_and_swapMethod · 0.45

Tested by

no test coverage detected