Commit 6a846488 authored by Dominik Charousset's avatar Dominik Charousset

Remove redundant state

parent 85c82d8c
...@@ -367,10 +367,6 @@ private: ...@@ -367,10 +367,6 @@ private:
pending_endpoints_map pending_endpoints_; pending_endpoints_map pending_endpoints_;
datagram_data_map datagram_data_; datagram_data_map datagram_data_;
// extra state for making sure the test multiplexer is not used in a
// multithreaded setup
std::thread::id tid_;
// Configures shortcuts for runnables. // Configures shortcuts for runnables.
size_t inline_runnables_; size_t inline_runnables_;
......
...@@ -294,13 +294,11 @@ void middleman::start() { ...@@ -294,13 +294,11 @@ void middleman::start() {
// Launch backend. // Launch backend.
if (system_.config().middleman_detach_multiplexer) if (system_.config().middleman_detach_multiplexer)
backend_supervisor_ = backend().make_supervisor(); backend_supervisor_ = backend().make_supervisor();
if (!backend_supervisor_) { // The only backend that returns a `nullptr` by default is the
// The only backend that returns a `nullptr` is the `test_multiplexer` // `test_multiplexer` which does not have its own thread but uses the main
// which does not have its own thread but uses the main thread instead. // thread instead. Other backends can set `middleman_detach_multiplexer` to
// Other backends can set `middleman_detach_multiplexer` to false to // false to suppress creation of the supervisor.
// suppress creation of the supervisor. if (backend_supervisor_ != nullptr) {
backend().thread_id(std::this_thread::get_id());
} else {
std::atomic<bool> init_done{false}; std::atomic<bool> init_done{false};
std::mutex mtx; std::mutex mtx;
std::condition_variable cv; std::condition_variable cv;
......
...@@ -23,7 +23,9 @@ namespace caf { ...@@ -23,7 +23,9 @@ namespace caf {
namespace io { namespace io {
namespace network { namespace network {
multiplexer::multiplexer(actor_system* sys) : execution_unit(sys) { multiplexer::multiplexer(actor_system* sys)
: execution_unit(sys),
tid_(std::this_thread::get_id()) {
// nop // nop
} }
......
...@@ -72,7 +72,6 @@ test_multiplexer::datagram_data:: ...@@ -72,7 +72,6 @@ test_multiplexer::datagram_data::
test_multiplexer::test_multiplexer(actor_system* sys) test_multiplexer::test_multiplexer(actor_system* sys)
: multiplexer(sys), : multiplexer(sys),
tid_(std::this_thread::get_id()),
inline_runnables_(0), inline_runnables_(0),
servant_ids_(0) { servant_ids_(0) {
CAF_ASSERT(sys != nullptr); CAF_ASSERT(sys != nullptr);
......
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