--------------------------------------------------------------------- thread_number()
| 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) |
no outgoing calls
no test coverage detected