refactor
This commit is contained in:
parent
43bf3c0cb2
commit
b4b688d3b9
@ -146,18 +146,20 @@ void client_pool::remove_client(const std::string &client_id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void client_pool::shutdown() {
|
void client_pool::shutdown() {
|
||||||
if (not shutdown_) {
|
if (shutdown_) {
|
||||||
event_system::instance().raise<service_shutdown_begin>("client_pool");
|
return;
|
||||||
unique_mutex_lock pool_lock(pool_mutex_);
|
|
||||||
if (not shutdown_) {
|
|
||||||
shutdown_ = true;
|
|
||||||
for (auto &pool_entry : pool_lookup_) {
|
|
||||||
pool_entry.second->shutdown();
|
|
||||||
}
|
|
||||||
pool_lookup_.clear();
|
|
||||||
}
|
|
||||||
pool_lock.unlock();
|
|
||||||
event_system::instance().raise<service_shutdown_end>("client_pool");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
event_system::instance().raise<service_shutdown_begin>("client_pool");
|
||||||
|
unique_mutex_lock pool_lock(pool_mutex_);
|
||||||
|
if (not shutdown_) {
|
||||||
|
shutdown_ = true;
|
||||||
|
for (auto &pool_entry : pool_lookup_) {
|
||||||
|
pool_entry.second->shutdown();
|
||||||
|
}
|
||||||
|
pool_lookup_.clear();
|
||||||
|
}
|
||||||
|
pool_lock.unlock();
|
||||||
|
event_system::instance().raise<service_shutdown_end>("client_pool");
|
||||||
}
|
}
|
||||||
} // namespace repertory
|
} // namespace repertory
|
||||||
|
Loading…
x
Reference in New Issue
Block a user