Shuts the thread pool down, causing the work queue to cease accepting offered work and the worker threads to terminate once they have processed their current work item. Returns once the shutdown flag has been set, does not wait for the threads to terminate.
| 123 | /// Returns once the shutdown flag has been set, does not wait for the threads to |
| 124 | /// terminate. |
| 125 | void Shutdown() { |
| 126 | { |
| 127 | std::lock_guard<std::mutex> l(lock_); |
| 128 | shutdown_ = true; |
| 129 | } |
| 130 | work_queue_.Shutdown(); |
| 131 | } |
| 132 | |
| 133 | /// Blocks until all threads are finished. Shutdown does not need to have been called, |
| 134 | /// since it may be called on a separate thread. |
no outgoing calls