refactor
This commit is contained in:
@ -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();
|
||||
}
|
||||
|
@ -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();
|
||||
|
||||
|
Reference in New Issue
Block a user