| 156 | } |
| 157 | |
| 158 | bool ThreadPool::AnyTaskPending() const { |
| 159 | for (size_t i = 0; i < m_num_threads; ++i) { |
| 160 | MutexLocker locker(&m_thread_contexts[i].mutex); |
| 161 | if (!m_thread_contexts[i].pending_tasks.empty()) |
| 162 | return true; |
| 163 | } |
| 164 | |
| 165 | return false; |
| 166 | } |
| 167 | |
| 168 | bool ThreadPool::AnyThreadRunning() const { |
| 169 | for (size_t i = 0; i < m_num_threads; ++i) { |