MCPcopy Create free account
hub / github.com/dmlc/dmlc-core / request_shutdown

Method request_shutdown

include/dmlc/thread_group.h:562–569  ·  view source on GitHub ↗

! * \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 */

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

size_approxMethod · 0.45
enqueueMethod · 0.45

Tested by

no test coverage detected