Commit 03c28411 authored by Mika Fischer's avatar Mika Fischer

Work around for LIBZMQ-496

The problem is that other threads might still be in mailbox::send() when
it is destroyed. So as a workaround, we just acquire the mutex in the
destructor. Therefore the running send will finish before the mailbox is
destroyed.

See also the fix for LIBZMQ-281 in zeromq2-x.
Signed-off-by: 's avatarMika Fischer <mika.fischer@zoopnet.de>
parent 3b132e33
......@@ -33,6 +33,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 ()
......
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