27 #if __TBB_WIN8UI_SUPPORT 53 #if __TBB_WIN8UI_SUPPORT 54 std::thread* thread_tmp=(std::thread*)my_thread_id;
57 #else // __TBB_WIN8UI_SUPPORT 58 DWORD status = WaitForSingleObjectEx(
my_handle, INFINITE, FALSE );
59 if ( status == WAIT_FAILED )
61 BOOL close_stat = CloseHandle(
my_handle );
62 if ( close_stat == 0 )
65 #endif // __TBB_WIN8UI_SUPPORT 67 int status = pthread_join(
my_handle, NULL );
70 #endif // _WIN32||_WIN64 86 #endif // _WIN32||_WIN64 93 #if __TBB_WIN8UI_SUPPORT 94 std::thread* thread_tmp=
new std::thread(start_routine, closure);
99 my_thread_id = (size_t)thread_tmp;
105 start_routine, closure, 0, &thread_id );
110 my_thread_id = thread_id;
116 pthread_attr_t stack_size;
117 status = pthread_attr_init( &stack_size );
124 status = pthread_create( &
thread_handle, &stack_size, start_routine, closure );
127 status = pthread_attr_destroy( &stack_size );
132 #endif // _WIN32||_WIN64 144 #endif // _WIN32||_WIN64 154 t1.my_thread_id = t2.my_thread_id;
156 #endif // _WIN32||_WIN64 170 double remainder = (i-(t1-t0)).seconds()*1e3;
171 if( remainder<=0 )
break;
172 DWORD t = remainder>=INFINITE ? INFINITE-1 : DWORD(remainder);
173 #if !__TBB_WIN8UI_SUPPORT 176 std::chrono::milliseconds sleep_time( t );
177 std::this_thread::sleep_for( sleep_time );
185 req.tv_sec = static_cast<long>(sec);
186 req.tv_nsec = static_cast<long>( (sec - req.tv_sec)*1e9 );
187 nanosleep(&req, NULL);
188 #endif // _WIN32||_WIN64 static tick_count now()
Return current time.
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
tbb_thread_v3::id __TBB_EXPORTED_FUNC thread_get_id_v3()
#define __TBB_NATIVE_THREAD_ROUTINE_PTR(r)
void __TBB_EXPORTED_METHOD join()
The completion of the thread represented by *this happens before join() returns.
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
void __TBB_EXPORTED_FUNC handle_perror(int error_code, const char *aux_info)
Throws std::runtime_error with what() returning error_code description prefixed with aux_info.
void __TBB_EXPORTED_METHOD detach()
When detach() returns, *this no longer represents the possibly continuing thread of execution.
static unsigned default_num_threads()
void __TBB_EXPORTED_FUNC thread_yield_v3()
void __TBB_EXPORTED_FUNC deallocate_via_handler_v3(void *p)
Deallocates memory using FreeHandler.
static size_t active_value(parameter p)
thread_monitor::handle_type thread_handle
bool joinable() const __TBB_NOEXCEPT(true)
#define __TBB_NOEXCEPT(expression)
void __TBB_EXPORTED_FUNC move_v3(tbb_thread_v3 &t1, tbb_thread_v3 &t2)
void __TBB_EXPORTED_FUNC free_closure_v3(void *)
Free a closure allocated by allocate_closure_v3.
__TBB_DEPRECATED_IN_VERBOSE_MODE tbb_thread::id get_id()
native_handle_type my_handle
void *__TBB_EXPORTED_FUNC allocate_closure_v3(size_t size)
Allocate a closure.
void handle_win_error(int error_code)
Throws std::runtime_error with what() returning error_code description prefixed with aux_info.
void __TBB_EXPORTED_FUNC thread_sleep_v3(const tick_count::interval_t &i)
double seconds() const
Return the length of a time interval in seconds.
id get_id() const __TBB_NOEXCEPT(true)
void __TBB_EXPORTED_METHOD internal_start(__TBB_NATIVE_THREAD_ROUTINE_PTR(start_routine), void *closure)
void *__TBB_EXPORTED_FUNC allocate_via_handler_v3(size_t n)
Allocates memory using MallocHandler.
static unsigned __TBB_EXPORTED_FUNC hardware_concurrency() __TBB_NOEXCEPT(true)
The number of hardware thread contexts.