Intel(R) Threading Building Blocks Doxygen Documentation
version 4.2.3
|
Versioned thread class. More...
#include <tbb_thread.h>
Classes | |
class | id |
Public Types | |
typedef pthread_t | native_handle_type |
Public Member Functions | |
tbb_thread_v3 () __TBB_NOEXCEPT(true) | |
Constructs a thread object that does not represent a thread of execution. More... | |
template<class F > | |
tbb_thread_v3 (F f) | |
Constructs an object and executes f() in a new thread. More... | |
template<class F , class X > | |
tbb_thread_v3 (F f, X x) | |
Constructs an object and executes f(x) in a new thread. More... | |
template<class F , class X , class Y > | |
tbb_thread_v3 (F f, X x, Y y) | |
Constructs an object and executes f(x,y) in a new thread. More... | |
tbb_thread_v3 (tbb_thread_v3 &&x) __TBB_NOEXCEPT(true) | |
tbb_thread_v3 & | operator= (tbb_thread_v3 &&x) __TBB_NOEXCEPT(true) |
void | swap (tbb_thread_v3 &t) __TBB_NOEXCEPT(true) |
bool | joinable () const __TBB_NOEXCEPT(true) |
void __TBB_EXPORTED_METHOD | join () |
The completion of the thread represented by *this happens before join() returns. More... | |
void __TBB_EXPORTED_METHOD | detach () |
When detach() returns, *this no longer represents the possibly continuing thread of execution. More... | |
~tbb_thread_v3 () | |
id | get_id () const __TBB_NOEXCEPT(true) |
native_handle_type | native_handle () |
Static Public Member Functions | |
static unsigned __TBB_EXPORTED_FUNC | hardware_concurrency () __TBB_NOEXCEPT(true) |
The number of hardware thread contexts. More... | |
Private Member Functions | |
tbb_thread_v3 (const tbb_thread_v3 &) | |
tbb_thread_v3 & | operator= (const tbb_thread_v3 &x) |
void | internal_wipe () __TBB_NOEXCEPT(true) |
void | internal_move (tbb_thread_v3 &x) __TBB_NOEXCEPT(true) |
void __TBB_EXPORTED_METHOD | internal_start (__TBB_NATIVE_THREAD_ROUTINE_PTR(start_routine), void *closure) |
Private Attributes | |
native_handle_type | my_handle |
Friends | |
void __TBB_EXPORTED_FUNC | move_v3 (tbb_thread_v3 &t1, tbb_thread_v3 &t2) |
void | tbb::swap (tbb_thread_v3 &t1, tbb_thread_v3 &t2) __TBB_NOEXCEPT(true) |
Versioned thread class.
Definition at line 122 of file tbb_thread.h.
typedef pthread_t tbb::internal::tbb_thread_v3::native_handle_type |
Definition at line 134 of file tbb_thread.h.
|
private |
|
inline |
Constructs a thread object that does not represent a thread of execution.
Definition at line 139 of file tbb_thread.h.
|
inlineexplicit |
Constructs an object and executes f() in a new thread.
Definition at line 146 of file tbb_thread.h.
References internal_start().
|
inline |
Constructs an object and executes f(x) in a new thread.
Definition at line 151 of file tbb_thread.h.
References internal_start().
|
inline |
Constructs an object and executes f(x,y) in a new thread.
Definition at line 156 of file tbb_thread.h.
References internal_start().
|
inline |
Definition at line 162 of file tbb_thread.h.
|
inline |
Definition at line 190 of file tbb_thread.h.
References detach(), and joinable().
void tbb::internal::tbb_thread_v3::detach | ( | ) |
When detach() returns, *this no longer represents the possibly continuing thread of execution.
Definition at line 74 of file tbb_thread.cpp.
References tbb::internal::handle_perror(), tbb::internal::handle_win_error(), joinable(), and my_handle.
Referenced by internal_move(), tbb::internal::move_v3(), and ~tbb_thread_v3().
|
inline |
Definition at line 269 of file tbb_thread.h.
Referenced by join().
|
static |
The number of hardware thread contexts.
Before TBB 3.0 U4 this methods returned the number of logical CPU in the system. Currently on Windows, Linux and FreeBSD it returns the number of logical CPUs available to the current process in accordance with its affinity mask.
NOTE: The return value of this method never changes after its first invocation. This means that changes in the process affinity mask that took place after this method was first invoked will not affect the number of worker threads in the TBB worker threads pool.
Definition at line 135 of file tbb_thread.cpp.
References tbb::internal::governor::default_num_threads().
|
inlineprivate |
Definition at line 217 of file tbb_thread.h.
References detach(), joinable(), and my_handle.
Referenced by operator=().
|
private |
Runs start_routine(closure) on another thread and sets my_handle to the handle of the created thread.
Definition at line 90 of file tbb_thread.cpp.
References tbb::interface9::global_control::active_value(), tbb::internal::handle_perror(), my_handle, and tbb::interface9::global_control::thread_stack_size.
Referenced by tbb_thread_v3().
|
inlineprivate |
void tbb::internal::tbb_thread_v3::join | ( | ) |
The completion of the thread represented by *this happens before join() returns.
Definition at line 46 of file tbb_thread.cpp.
References get_id(), tbb::this_tbb_thread::get_id(), tbb::internal::handle_perror(), tbb::internal::handle_win_error(), joinable(), and my_handle.
|
inline |
Definition at line 185 of file tbb_thread.h.
References my_handle.
Referenced by detach(), internal_move(), join(), tbb::internal::move_v3(), and ~tbb_thread_v3().
|
inline |
|
inline |
Definition at line 170 of file tbb_thread.h.
References internal_move().
|
private |
|
inline |
Definition at line 184 of file tbb_thread.h.
References tbb::swap().
|
friend |
Definition at line 147 of file tbb_thread.cpp.
|
friend |
|
private |
Definition at line 206 of file tbb_thread.h.
Referenced by detach(), get_id(), internal_move(), internal_start(), internal_wipe(), join(), joinable(), tbb::internal::move_v3(), and native_handle().