summaryrefslogtreecommitdiff
path: root/src/mailbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailbox.cpp')
-rw-r--r--src/mailbox.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mailbox.cpp b/src/mailbox.cpp
index a99a9ec..24fa739 100644
--- a/src/mailbox.cpp
+++ b/src/mailbox.cpp
@@ -35,6 +35,11 @@ zmq::mailbox_t::mailbox_t ()
zmq::mailbox_t::~mailbox_t ()
{
// TODO: Retrieve and deallocate commands inside the cpipe.
+
+ // Work around problem that other threads might still be in our
+ // send() method, by waiting on the mutex before disappearing.
+ sync.lock ();
+ sync.unlock ();
}
zmq::fd_t zmq::mailbox_t::get_fd ()