| 459 | } |
| 460 | |
| 461 | void BackgroundWorker::Schedule(std::function<void()> work_item) { |
| 462 | { |
| 463 | mutex_lock l(mu_); |
| 464 | work_queue_.push_back(std::move(work_item)); |
| 465 | } |
| 466 | cond_var_.notify_one(); |
| 467 | } |
| 468 | |
| 469 | void BackgroundWorker::WorkerLoop() { |
| 470 | while (true) { |