| 50 | } |
| 51 | |
| 52 | void Func(size_t id) { |
| 53 | int n = 0; |
| 54 | do { |
| 55 | bool succ = thd_queue_->pluck(n); |
| 56 | if (succ) { |
| 57 | printf("thread_id(%zu) value(%d)\n", id, n); |
| 58 | } else { |
| 59 | break; |
| 60 | } |
| 61 | } while (!thd_queue_->empty()); |
| 62 | } |
| 63 | |
| 64 | private: |
| 65 | ThdQueue<int> * thd_queue_; |