Minor cleanup

This commit is contained in:
gabime 2024-12-06 10:28:00 +02:00
parent 7fc6f1719c
commit d2299fcc31

View File

@ -59,18 +59,18 @@ void context::set_default_logger(std::shared_ptr<logger> new_default_logger) {
} }
void context::set_tp(std::shared_ptr<thread_pool> tp) { void context::set_tp(std::shared_ptr<thread_pool> tp) {
std::lock_guard<std::recursive_mutex> lock(tp_mutex_); std::lock_guard lock(tp_mutex_);
tp_ = std::move(tp); tp_ = std::move(tp);
} }
std::shared_ptr<thread_pool> context::get_tp() { std::shared_ptr<thread_pool> context::get_tp() {
std::lock_guard<std::recursive_mutex> lock(tp_mutex_); std::lock_guard lock(tp_mutex_);
return tp_; return tp_;
} }
// clean all resources and threads started by the registry // clean all resources and threads started by the registry
void context::shutdown() { void context::shutdown() {
std::lock_guard<std::recursive_mutex> lock(tp_mutex_); std::lock_guard lock(tp_mutex_);
tp_.reset(); tp_.reset();
} }