Commit 74dbde15 authored by Jakob Otto's avatar Jakob Otto

Include review feedback

parent 09626172
......@@ -93,9 +93,8 @@ public:
void run();
/// Signals the multiplexer to initiate shutdown.
/// @returns true if manual triggering is needed, false if not.
/// @thread-safe
bool shutdown();
void shutdown();
protected:
// -- utility functions ------------------------------------------------------
......
......@@ -230,7 +230,7 @@ void multiplexer::run() {
poll_once(true);
}
bool multiplexer::shutdown() {
void multiplexer::shutdown() {
if (std::this_thread::get_id() == tid_) {
will_shutdown_ = true;
if (managers_.size() == 1) {
......@@ -240,10 +240,9 @@ bool multiplexer::shutdown() {
for (size_t i = 1; i < managers_.size(); ++i)
write_to_pipe(4, managers_[i]);
}
return true;
} else {
write_to_pipe(5, nullptr);
return false;
run();
}
}
......
......@@ -55,11 +55,8 @@ void middleman::start() {
void middleman::stop() {
for (const auto& backend : backends_)
backend->stop();
if (mpx_->shutdown()) {
mpx_->run();
} else if (mpx_thread_.joinable()) {
if (mpx_thread_.joinable())
mpx_thread_.join();
}
}
void middleman::init(actor_system_config& cfg) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment