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

Method local_spawn_root_and_wait

benchmarks/tbb/scheduler.cpp:641–660  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

639}
640
641void generic_scheduler::local_spawn_root_and_wait( task& first, task*& next ) {
642 __TBB_ASSERT( governor::is_set(this), NULL );
643 __TBB_ASSERT( &first, NULL );
644 auto_empty_task dummy( __TBB_CONTEXT_ARG(this, first.prefix().context) );
645 internal::reference_count n = 0;
646 for( task* t=&first; ; t=t->prefix().next ) {
647 ++n;
648 __TBB_ASSERT( !t->prefix().parent, "not a root task, or already running" );
649 t->prefix().parent = &dummy;
650 if( &t->prefix().next==&next ) break;
651#if __TBB_TASK_GROUP_CONTEXT
652 __TBB_ASSERT( t->prefix().context == t->prefix().next->prefix().context,
653 "all the root tasks in list must share the same context");
654#endif /* __TBB_TASK_GROUP_CONTEXT */
655 }
656 dummy.prefix().ref_count = n+1;
657 if( n>1 )
658 local_spawn( *first.prefix().next, next );
659 local_wait_for_all( dummy, &first );
660}
661
662void tbb::internal::generic_scheduler::spawn( task& first, task*& next ) {
663 governor::local_scheduler()->local_spawn( first, next );

Callers 1

spawn_root_and_waitMethod · 0.80

Calls 1

is_setFunction · 0.85

Tested by

no test coverage detected