From c41d514b8ba5b92a4c1a6ec571bb75aeb48898da Mon Sep 17 00:00:00 2001 From: Doron Somech Date: Tue, 10 May 2016 16:23:29 +0300 Subject: [PATCH] Revert "problem:Socket try to access closed mutex" --- src/socket_base.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/socket_base.cpp b/src/socket_base.cpp index aff304f1..d3eeb4cb 100644 --- a/src/socket_base.cpp +++ b/src/socket_base.cpp @@ -1282,7 +1282,7 @@ int zmq::socket_base_t::recv (msg_t *msg_, int flags_) int zmq::socket_base_t::close () { ENTER_MUTEX (); - + // Remove all existing signalers for thread safe sockets if (thread_safe) ((mailbox_safe_t*)mailbox)->clear_signalers(); @@ -1514,12 +1514,14 @@ void zmq::socket_base_t::in_event () // of the reaper thread. Process any commands from other threads/sockets // that may be available at the moment. Ultimately, the socket will // be destroyed. + ENTER_MUTEX (); // If the socket is thread safe we need to unsignal the reaper signaler if (thread_safe) reaper_signaler->recv(); process_commands (0, false); + EXIT_MUTEX(); check_destroy(); }