MCPcopy Create free account
hub / github.com/cameron314/concurrentqueue / join

Method join

benchmarks/tbb/tbb_thread.cpp:49–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49void tbb_thread_v3::join()
50{
51 if (!joinable())
52 handle_perror( EINVAL, "tbb_thread::join" ); // Invalid argument
53 if (this_tbb_thread::get_id() == get_id())
54 handle_perror( EDEADLK, "tbb_thread::join" ); // Resource deadlock avoided
55#if _WIN32||_WIN64
56#if __TBB_WIN8UI_SUPPORT
57 std::thread* thread_tmp=(std::thread*)my_thread_id;
58 thread_tmp->join();
59 delete thread_tmp;
60#else // __TBB_WIN8UI_SUPPORT
61 DWORD status = WaitForSingleObjectEx( my_handle, INFINITE, FALSE );
62 if ( status == WAIT_FAILED )
63 handle_win_error( GetLastError() );
64 BOOL close_stat = CloseHandle( my_handle );
65 if ( close_stat == 0 )
66 handle_win_error( GetLastError() );
67 my_thread_id = 0;
68#endif // __TBB_WIN8UI_SUPPORT
69#else
70 int status = pthread_join( my_handle, NULL );
71 if( status )
72 handle_perror( status, "pthread_join" );
73#endif // _WIN32||_WIN64
74 my_handle = 0;
75}
76
77void tbb_thread_v3::detach() {
78 if (!joinable())

Callers 1

runBenchmarkFunction · 0.45

Calls 4

handle_perrorFunction · 0.85
get_idFunction · 0.85
handle_win_errorFunction · 0.85
GetLastErrorFunction · 0.85

Tested by

no test coverage detected