MCPcopy Create free account
hub / github.com/coin-or/CppAD / thread_number

Function thread_number

example/multi_thread/pthread/team_pthread.cpp:95–105  ·  view source on GitHub ↗

--------------------------------------------------------------------- thread_number()

Source from the content-addressed store, hash-verified

93 // ---------------------------------------------------------------------
94 // thread_number()
95 size_t thread_number(void)
96 { // get thread specific information
97 void* thread_num_vptr = pthread_getspecific(thread_specific_key_);
98 size_t* thread_num_ptr = static_cast<size_t*>(thread_num_vptr);
99 size_t thread_num = *thread_num_ptr;
100 if( thread_num >= num_threads_ )
101 { std::cerr << "thread_number: program error" << std::endl;
102 exit(1);
103 }
104 return thread_num;
105 }
106 // --------------------------------------------------------------------
107 // function that gets called by pthread_create
108 void* thread_work(void* thread_num_vptr)

Callers 2

team_workFunction · 0.70
team_destroyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected