| 47 | } |
| 48 | |
| 49 | void* push_thread(void* arg) { |
| 50 | size_t npushed = 0; |
| 51 | value_type seed = 0; |
| 52 | bthread::WorkStealingQueue<value_type> *q = |
| 53 | (bthread::WorkStealingQueue<value_type>*)arg; |
| 54 | while (true) { |
| 55 | pthread_mutex_lock(&mutex); |
| 56 | const bool pushed = q->push(seed); |
| 57 | pthread_mutex_unlock(&mutex); |
| 58 | if (pushed) { |
| 59 | ++seed; |
| 60 | if (++npushed == N) { |
| 61 | g_stop = true; |
| 62 | break; |
| 63 | } |
| 64 | } |
| 65 | } |
| 66 | return NULL; |
| 67 | } |
| 68 | |
| 69 | void* pop_thread(void* arg) { |
| 70 | std::vector<value_type> *popped = new std::vector<value_type>; |
nothing calls this directly
no test coverage detected