diff options
author | Determinant <[email protected]> | 2019-04-07 17:46:53 -0400 |
---|---|---|
committer | Determinant <[email protected]> | 2019-04-07 17:46:53 -0400 |
commit | 03e96c4ee3dcf14873a1cdad12509683006a3329 (patch) | |
tree | 12dba4b84ffc4b862c897e1fcd5ce862d42d7bd6 | |
parent | 8a0d8fbaf59be7acc536b2a753caa27aa1fbae24 (diff) |
stop the workers before MsgNetwork releases the queue
-rw-r--r-- | include/salticidae/event.h | 3 | ||||
-rw-r--r-- | include/salticidae/network.h | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/include/salticidae/event.h b/include/salticidae/event.h index df49c58..946dda1 100644 --- a/include/salticidae/event.h +++ b/include/salticidae/event.h @@ -547,7 +547,6 @@ class MPMCQueueEventDriven: public MPMCQueue<T> { class ThreadCall { public: class Handle; private: - int ctl_fd[2]; EventContext ec; const size_t burst_size; using queue_t = MPSCQueueEventDriven<Handle *>; @@ -621,8 +620,6 @@ class ThreadCall { ~ThreadCall() { Handle *h; while (q.try_dequeue(h)) delete h; - close(ctl_fd[0]); - close(ctl_fd[1]); } template<typename Func> diff --git a/include/salticidae/network.h b/include/salticidae/network.h index 11f720a..f3dd313 100644 --- a/include/salticidae/network.h +++ b/include/salticidae/network.h @@ -144,6 +144,8 @@ class MsgNetwork: public ConnPool { } }; + ~MsgNetwork() { stop_workers(); } + MsgNetwork(const EventContext &ec, const Config &config): ConnPool(ec, config) { incoming_msgs.set_capacity(65536); |