From 03e96c4ee3dcf14873a1cdad12509683006a3329 Mon Sep 17 00:00:00 2001 From: Determinant Date: Sun, 7 Apr 2019 17:46:53 -0400 Subject: stop the workers before MsgNetwork releases the queue --- include/salticidae/event.h | 3 --- 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 { class ThreadCall { public: class Handle; private: - int ctl_fd[2]; EventContext ec; const size_t burst_size; using queue_t = MPSCQueueEventDriven; @@ -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 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); -- cgit v1.2.3-70-g09d2