| 50 | |
| 51 | STDEXEC_ATTRIBUTE(host, device) |
| 52 | void run() noexcept |
| 53 | { |
| 54 | // execute work items until the __finishing_ flag is set: |
| 55 | while (!__finishing_.load(__std::memory_order_acquire)) |
| 56 | { |
| 57 | __queue_.wait_for_item(); |
| 58 | __execute_all(); |
| 59 | } |
| 60 | // drain the queue, taking care to execute any tasks that get added while |
| 61 | // executing the remaining tasks (also wait for other tasks that might still be in flight): |
| 62 | while (__execute_all() || __task_count_.load(__std::memory_order_acquire) > 0) |
| 63 | ; |
| 64 | } |
| 65 | |
| 66 | STDEXEC_ATTRIBUTE(host, device) |
| 67 | void finish() noexcept |
no test coverage detected