21 #ifndef __TBB_task_group_H 22 #define __TBB_task_group_H 28 #if __TBB_TASK_GROUP_CONTEXT 58 #if __TBB_CPP11_RVALUE_REF_PRESENT 74 class task_handle_task :
public task {
116 template<
typename Task,
typename F>
118 owner().spawn( *
new(
owner().allocate_additional_child_of(*
my_root) ) Task( internal::forward<F>(f) ));
131 #if __TBB_CPP17_UNCAUGHT_EXCEPTIONS_PRESENT 132 bool stack_unwinding_in_progress = std::uncaught_exceptions() > 0;
134 bool stack_unwinding_in_progress = std::uncaught_exception();
147 if ( !stack_unwinding_in_progress )
157 internal_run< internal::task_handle_task<F> >(
h );
193 internal_run< internal::task_handle_task<F> >(
h );
199 #if __TBB_CPP11_RVALUE_REF_PRESENT 206 void run(
const F& f) {
207 internal_run<internal::function_task<F> >(f);
213 return internal_run_and_wait<const F>( f );
220 return internal_run_and_wait< task_handle<F> >(
h );
230 return internal_run_and_wait< task_handle<F> >(
h );
245 #if __TBB_CPP11_RVALUE_REF_PRESENT 253 return task_handle<F>( f );
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function h
void __TBB_EXPORTED_METHOD register_pending_exception()
Records the pending exception, and cancels the task group.
task_handle< F > & my_handle
task_group_base(uintptr_t traits=0)
void internal_run(__TBB_FORWARDING_REF(F) f)
#define __TBB_NOEXCEPT(expression)
task that does nothing. Useful for synchronization.
task_group_status run_and_wait(task_handle< F > &h)
Used to form groups of tasks.
bool is_current_task_group_canceling()
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_id __itt_string_handle __itt_metadata_type type
task_handle_task(task_handle< F > &h)
task_group_status run_and_wait(const F &f)
bool __TBB_EXPORTED_METHOD cancel_group_execution()
Initiates cancellation of all tasks in this cancellation group and its subordinate groups.
Base class for user-defined tasks.
static task &__TBB_EXPORTED_FUNC self()
The innermost task being executed or destroyed by the current thread at the moment.
static const intptr_t scheduled
void __TBB_EXPORTED_METHOD reset()
Forcefully reinitializes the context after the task tree it was associated with is completed.
void throw_exception(exception_id eid)
Versionless convenience wrapper for throw_exception_v4()
void wait_for_all()
Wait for reference count to become one, and set reference count to zero.
friend class internal::task_handle_task
task_handle< typename internal::strip< F >::type > make_task(F &&f)
~task_group_base() __TBB_NOEXCEPT(false)
#define __TBB_FORWARDING_REF(A)
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task * task
int decrement_ref_count()
Atomically decrement reference count and returns its new value.
task_group_status run_and_wait(task_handle< F > &h)
task * execute() __TBB_override
Should be overridden by derived classes.
bool __TBB_EXPORTED_METHOD is_group_execution_cancelled() const
Returns true if the context received cancellation request.
void increment_ref_count()
Atomically increment reference count.
void move(tbb_thread &t1, tbb_thread &t2)
void run(task_handle< F > &h)
bool is_cancelled() const
Returns true if the context has received cancellation request.
void set_ref_count(int count)
Set reference count.
static internal::allocate_root_proxy allocate_root()
Returns proxy for overloaded new that allocates a root task.
task_group_status internal_run_and_wait(F &f)
task_group_context my_context
int ref_count() const
The internal reference count.