| 218 | } |
| 219 | |
| 220 | void manual_executor::shutdown() { |
| 221 | const auto abort = m_atomic_abort.exchange(true, std::memory_order_relaxed); |
| 222 | if (abort) { |
| 223 | return; // shutdown had been called before. |
| 224 | } |
| 225 | |
| 226 | decltype(m_tasks) tasks; |
| 227 | |
| 228 | { |
| 229 | std::unique_lock<decltype(m_lock)> lock(m_lock); |
| 230 | m_abort = true; |
| 231 | tasks = std::move(m_tasks); |
| 232 | } |
| 233 | |
| 234 | m_condition.notify_all(); |
| 235 | |
| 236 | tasks.clear(); |
| 237 | } |
| 238 | |
| 239 | bool manual_executor::shutdown_requested() const { |
| 240 | return m_atomic_abort.load(std::memory_order_relaxed); |
nothing calls this directly
no test coverage detected