| 67 | } |
| 68 | |
| 69 | void* pop_thread(void* arg) { |
| 70 | std::vector<value_type> *popped = new std::vector<value_type>; |
| 71 | popped->reserve(N); |
| 72 | bthread::WorkStealingQueue<value_type> *q = |
| 73 | (bthread::WorkStealingQueue<value_type>*)arg; |
| 74 | while (!g_stop) { |
| 75 | value_type val; |
| 76 | pthread_mutex_lock(&mutex); |
| 77 | const bool res = q->pop(&val); |
| 78 | pthread_mutex_unlock(&mutex); |
| 79 | if (res) { |
| 80 | popped->push_back(val); |
| 81 | } |
| 82 | } |
| 83 | return popped; |
| 84 | } |
| 85 | |
| 86 | |
| 87 | TEST(WSQTest, sanity) { |
nothing calls this directly
no test coverage detected