! * \brief Signal the thread that a shutdown is desired * \note Since consumer doesn't necessarily get items in order, we must wait for * the queue to empty. * This is generally a shutdown procedure and should not be called from * a performance-sensitive area */
| 560 | * a performance-sensitive area |
| 561 | */ |
| 562 | void request_shutdown() override { |
| 563 | shutdown_in_progress_ = true; |
| 564 | while (queue_->size_approx() > 0 && !ThreadGroup::Thread::is_shutdown_requested()) { |
| 565 | std::this_thread::sleep_for(std::chrono::milliseconds(1)); |
| 566 | } |
| 567 | ThreadGroup::Thread::request_shutdown(); |
| 568 | queue_->enqueue(quit_item); |
| 569 | } |
| 570 | |
| 571 | /*! |
| 572 | * \brief Enqueue and item |
nothing calls this directly
no test coverage detected