本文整理汇总了C++中task::prefix方法的典型用法代码示例。如果您正苦于以下问题:C++ task::prefix方法的具体用法?C++ task::prefix怎么用?C++ task::prefix使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类task
的用法示例。
在下文中一共展示了task::prefix方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void interface5::internal::task_base::destroy( task& victim ) {
__TBB_ASSERT( victim.prefix().ref_count== (ConcurrentWaitsEnabled(victim) ? 1 : 0), "Task being destroyed must not have children" );
__TBB_ASSERT( victim.state()==task::allocated, "illegal state for victim task" );
task* parent = victim.parent();
victim.~task();
if( parent ) {
__TBB_ASSERT( parent->state()==task::allocated, "attempt to destroy child of running or corrupted parent?" );
parent->internal_decrement_ref_count();
// Despite last reference to *parent removed, it should not be destroyed (documented behavior).
}
governor::local_scheduler()->free_task<no_hint>( victim );
}
示例2:
void interface5::internal::task_base::destroy( task& victim ) {
// 1 may be a guard reference for wait_for_all, which was not reset because
// of concurrent_wait mode or because prepared root task was not actually used
// for spawning tasks (as in structured_task_group).
__TBB_ASSERT( (intptr_t)victim.prefix().ref_count <= 1, "Task being destroyed must not have children" );
__TBB_ASSERT( victim.state()==task::allocated, "illegal state for victim task" );
task* parent = victim.parent();
victim.~task();
if( parent ) {
__TBB_ASSERT( parent->state()==task::allocated, "attempt to destroy child of running or corrupted parent?" );
parent->internal_decrement_ref_count();
// Even if the last reference to *parent is removed, it should not be spawned (documented behavior).
}
governor::local_scheduler()->free_task<no_hint>( victim );
}