| 258 | } |
| 259 | |
| 260 | void ThreadPoolBase::PopUnlockAndRunTask(std::unique_lock<std::mutex> &lock) noexcept { |
| 261 | TaskFunc t = std::move(tasks_.front()); |
| 262 | tasks_.pop(); |
| 263 | lock.unlock(); |
| 264 | t(); |
| 265 | } |
| 266 | |
| 267 | template <typename Condition> |
| 268 | bool ThreadPoolBase::WaitOrRunTasks(std::condition_variable &cv, Condition &&condition) { |