21 #ifndef __TBB_tbb_thread_H 22 #define __TBB_tbb_thread_H 28 #define __TBB_NATIVE_THREAD_ROUTINE unsigned WINAPI 29 #define __TBB_NATIVE_THREAD_ROUTINE_PTR(r) unsigned (WINAPI* r)( void* ) 30 namespace tbb {
namespace internal {
31 #if __TBB_WIN8UI_SUPPORT 33 #else // __TBB_WIN8UI_SUPPORT 35 #endif // __TBB_WIN8UI_SUPPORT 38 #define __TBB_NATIVE_THREAD_ROUTINE void* 39 #define __TBB_NATIVE_THREAD_ROUTINE_PTR(r) void* (*r)( void* ) 41 namespace tbb {
namespace internal {
44 #endif // _WIN32||_WIN64 50 #include __TBB_STD_SWAP_HEADER 59 inline void swap( internal::tbb_thread_v3& t1, internal::tbb_thread_v3& t2 )
__TBB_NOEXCEPT(
true);
91 self->function(self->arg1);
104 self->function(self->arg1, self->arg2);
113 #if __TBB_IF_NO_COPY_CTOR_MOVE_SEMANTICS_BROKEN 125 #endif // _WIN32||_WIN64 132 #endif // _WIN32||_WIN64 137 typedef internal::thread_closure_0<F> closure_type;
142 typedef internal::thread_closure_1<F,X> closure_type;
143 internal_start(closure_type::start_routine,
new closure_type(f,x));
147 typedef internal::thread_closure_2<F,X,Y> closure_type;
148 internal_start(closure_type::start_routine,
new closure_type(f,x,y));
151 #if __TBB_CPP11_RVALUE_REF_PRESENT 155 , my_thread_id(x.my_thread_id)
167 #else // __TBB_CPP11_RVALUE_REF_PRESENT 172 #endif // __TBB_CPP11_RVALUE_REF_PRESENT 199 #endif // _WIN32||_WIN64 211 my_thread_id = x.my_thread_id;
212 #endif // _WIN32||_WIN64 238 template<
class charT,
class traits>
239 friend std::basic_ostream<charT, traits>&
249 __TBB_STATIC_ASSERT(
sizeof(
id.
my_id) <=
sizeof(
size_t),
"Implementaion assumes that thread_id_type fits into machine word");
261 return id(my_thread_id);
264 #endif // _WIN32||_WIN64 274 return x.my_id == y.my_id;
278 return x.my_id != y.my_id;
282 return x.my_id < y.my_id;
286 return x.my_id <= y.my_id;
290 return x.my_id > y.my_id;
294 return x.my_id >= y.my_id;
302 using internal::operator==;
303 using internal::operator!=;
304 using internal::operator<;
305 using internal::operator>;
306 using internal::operator<=;
307 using internal::operator>=;
316 std::swap(t1.my_thread_id, t2.my_thread_id);
320 namespace this_tbb_thread {
friend size_t tbb_hasher(const tbb_thread_v3::id &id)
tbb_thread_v3() __TBB_NOEXCEPT(true)
Constructs a thread object that does not represent a thread of execution.
friend void __TBB_EXPORTED_FUNC move_v3(tbb_thread_v3 &t1, tbb_thread_v3 &t2)
size_t tbb_hasher(const T &t)
Hasher functions.
thread_closure_0(const F &f)
#define __TBB_NATIVE_THREAD_ROUTINE
friend id atomic_compare_and_swap(id &location, const id &value, const id &comparand)
tbb_thread_v3(tbb_thread_v3 &&x) __TBB_NOEXCEPT(true)
Structure used to pass user function with 1 argument to thread.
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 id
void internal_wipe() __TBB_NOEXCEPT(true)
#define __TBB_STATIC_ASSERT(condition, msg)
bool operator==(const vector_iterator< Container, T > &i, const vector_iterator< Container, U > &j)
void swap(tbb_thread_v3 &t) __TBB_NOEXCEPT(true)
static unsigned __TBB_EXPORTED_FUNC hardware_concurrency() __TBB_NOEXCEPT(true)
The number of hardware thread contexts.
tbb_thread_v3(F f)
Constructs an object and executes f() in a new thread.
#define __TBB_NOEXCEPT(expression)
friend bool operator!=(tbb_thread_v3::id x, tbb_thread_v3::id y) __TBB_NOEXCEPT(true)
native_handle_type my_handle
void swap(internal::tbb_thread_v3 &t1, internal::tbb_thread_v3 &t2) __TBB_NOEXCEPT(true)
void __TBB_EXPORTED_FUNC free_closure_v3(void *)
Free a closure allocated by allocate_closure_v3.
static __TBB_NATIVE_THREAD_ROUTINE start_routine(void *c)
Routine passed to Windows's _beginthreadex by thread::internal_start() inside tbb....
thread_closure_2(const F &f, const X &x, const Y &y)
friend bool operator>(tbb_thread_v3::id x, tbb_thread_v3::id y) __TBB_NOEXCEPT(true)
bool operator!=(const vector_iterator< Container, T > &i, const vector_iterator< Container, U > &j)
void sleep(const tick_count::interval_t &i)
The current thread blocks at least until the time specified.
friend bool operator==(tbb_thread_v3::id x, tbb_thread_v3::id y) __TBB_NOEXCEPT(true)
tbb_thread_v3(F f, X x)
Constructs an object and executes f(x) in a new thread.
void __TBB_EXPORTED_METHOD join()
The completion of the thread represented by *this happens before join() returns.
pthread_t native_handle_type
bool operator>(const vector_iterator< Container, T > &i, const vector_iterator< Container, U > &j)
static __TBB_NATIVE_THREAD_ROUTINE start_routine(void *c)
Routine passed to Windows's _beginthreadex by thread::internal_start() inside tbb....
bool operator<=(const vector_iterator< Container, T > &i, const vector_iterator< Container, U > &j)
static __TBB_NATIVE_THREAD_ROUTINE start_routine(void *c)
void __TBB_EXPORTED_FUNC move_v3(tbb_thread_v3 &t1, tbb_thread_v3 &t2)
#define __TBB_EXPORTED_METHOD
#define __TBB_NATIVE_THREAD_ROUTINE_PTR(r)
id() __TBB_NOEXCEPT(true)
void swap(concurrent_hash_map< Key, T, HashCompare, A > &a, concurrent_hash_map< Key, T, HashCompare, A > &b)
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 value
void __TBB_EXPORTED_FUNC thread_yield_v3()
thread_closure_1(const F &f, const X &x)
void __TBB_EXPORTED_METHOD detach()
When detach() returns, *this no longer represents the possibly continuing thread of execution.
native_handle_type native_handle()
friend tbb_thread_v3::id __TBB_EXPORTED_FUNC thread_get_id_v3()
#define __TBB_EXPORTED_FUNC
void move(tbb_thread &t1, tbb_thread &t2)
friend std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &out, tbb_thread_v3::id id)
friend bool operator>=(tbb_thread_v3::id x, tbb_thread_v3::id y) __TBB_NOEXCEPT(true)
id get_id() const __TBB_NOEXCEPT(true)
void __TBB_EXPORTED_METHOD internal_start(__TBB_NATIVE_THREAD_ROUTINE_PTR(start_routine), void *closure)
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 size
internal::tbb_thread_v3 tbb_thread
Users reference thread class by name tbb_thread.
bool operator>=(const vector_iterator< Container, T > &i, const vector_iterator< Container, U > &j)
tbb_thread_v3(F f, X x, Y y)
Constructs an object and executes f(x,y) in a new thread.
friend bool operator<=(tbb_thread_v3::id x, tbb_thread_v3::id y) __TBB_NOEXCEPT(true)
void *__TBB_EXPORTED_FUNC allocate_closure_v3(size_t size)
Allocate a closure.
bool joinable() const __TBB_NOEXCEPT(true)
bool operator<(const vector_iterator< Container, T > &i, const vector_iterator< Container, U > &j)
void yield()
Offers the operating system the opportunity to schedule another thread.
friend bool operator<(tbb_thread_v3::id x, tbb_thread_v3::id y) __TBB_NOEXCEPT(true)
atomic< T > & as_atomic(T &t)
tbb_thread_v3::id __TBB_EXPORTED_FUNC thread_get_id_v3()
void internal_move(tbb_thread_v3 &x) __TBB_NOEXCEPT(true)
void __TBB_EXPORTED_FUNC thread_sleep_v3(const tick_count::interval_t &i)
tbb_thread_v3 & operator=(tbb_thread_v3 &&x) __TBB_NOEXCEPT(true)