| 628 | } |
| 629 | |
| 630 | void WorkQueue::SpinUntilAllThreadsAreWaiting() { |
| 631 | while (true) { |
| 632 | { |
| 633 | butil::AutoLock auto_lock(lock_); |
| 634 | if (waiting_thread_count_ == thread_count_) |
| 635 | break; |
| 636 | } |
| 637 | PlatformThread::Sleep(TimeDelta::FromMilliseconds(30)); |
| 638 | } |
| 639 | } |
| 640 | |
| 641 | void WorkQueue::SpinUntilTaskCountLessThan(int task_count) { |
| 642 | while (true) { |