mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-09 15:26:04 +00:00
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: Mika Fischer <mika.fischer@zoopnet.de>
This commit is contained in:
parent
3b132e337e
commit
03c28411d8
@ -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 ()
|
||||
|
Loading…
x
Reference in New Issue
Block a user