This commit is contained in:
2025-01-22 13:01:36 -06:00
parent 57a591c51e
commit cbbd586347
2 changed files with 7 additions and 3 deletions

View File

@ -232,11 +232,14 @@ public:
stop_requested_ = true;
std::unique_ptr<std::thread> thread{nullptr};
std::swap(thread, event_thread_);
event_notify_.notify_all();
lock.unlock();
event_thread_->join();
event_thread_.reset();
thread->join();
thread.reset();
process_events();
}

View File

@ -60,10 +60,11 @@ void single_thread_service_base::stop() {
event_system::instance().raise<service_shutdown_begin>(service_name_);
stop_requested_ = true;
std::unique_ptr<std::thread> thread{nullptr};
std::swap(thread, thread_);
stop_requested_ = true;
notify_.notify_all();
lock.unlock();