21 #ifndef __TBB_task_scheduler_init_H 22 #define __TBB_task_scheduler_init_H 24 #include "tbb_stddef.h" 29 typedef std::size_t stack_size_type;
54 enum ExceptionPropagationMode {
55 propagation_mode_exact = 1u,
56 propagation_mode_captured = 2u,
57 propagation_mode_mask = propagation_mode_exact | propagation_mode_captured
59 #if __TBB_SUPPORTS_WORKERS_WAITING_IN_TERMINATE 61 wait_workers_in_terminate_flag = 128u
66 internal::scheduler* my_scheduler;
70 static const int automatic = -1;
73 static const int deferred = -2;
87 void __TBB_EXPORTED_METHOD initialize(
int number_of_threads=automatic );
91 void __TBB_EXPORTED_METHOD initialize(
int number_of_threads, stack_size_type thread_stack_size );
94 void __TBB_EXPORTED_METHOD terminate();
97 #if __TBB_SUPPORTS_WORKERS_WAITING_IN_TERMINATE 98 task_scheduler_init(
int number_of_threads=automatic, stack_size_type thread_stack_size=0,
bool wait_workers_in_terminate =
false ) : my_scheduler(NULL)
100 task_scheduler_init( int number_of_threads=automatic, stack_size_type thread_stack_size=0 ) : my_scheduler(NULL)
110 __TBB_ASSERT( !(thread_stack_size & propagation_mode_mask),
"Requested stack size is not aligned" );
111 #if TBB_USE_EXCEPTIONS 112 thread_stack_size |= TBB_USE_CAPTURED_EXCEPTION ? propagation_mode_captured : propagation_mode_exact;
114 #if __TBB_SUPPORTS_WORKERS_WAITING_IN_TERMINATE 115 if (wait_workers_in_terminate)
116 my_scheduler = (internal::scheduler*)wait_workers_in_terminate_flag;
118 initialize( number_of_threads, thread_stack_size );
125 internal::poison_pointer( my_scheduler );
145 static int __TBB_EXPORTED_FUNC default_num_threads ();
Class delimiting the scope of task scheduler activity.
Definition: task_scheduler_init.h:53
bool is_active() const
Returns true if scheduler is active (initialized); false otherwise.
Definition: task_scheduler_init.h:148
*/
Definition: material.h:665
Definition: _flow_graph_async_msg_impl.h:32
~task_scheduler_init()
Destroy scheduler for this thread if thread has no other live task_scheduler_inits.
Definition: task_scheduler_init.h:122
The namespace tbb contains all components of the library.
Definition: parallel_for.h:44