mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-05 03:37:36 +01:00
Bind pending connections on terminate outside lock.
This commit is contained in:
parent
668c42fc26
commit
12442a3d65
15
src/ctx.cpp
15
src/ctx.cpp
@ -95,6 +95,14 @@ zmq::ctx_t::~ctx_t ()
|
||||
|
||||
int zmq::ctx_t::terminate ()
|
||||
{
|
||||
// Connect up any pending inproc connections, otherwise we will hang
|
||||
pending_connections_t copy = pending_connections;
|
||||
for (pending_connections_t::iterator p = copy.begin (); p != copy.end (); ++p) {
|
||||
zmq::socket_base_t *s = create_socket (ZMQ_PAIR);
|
||||
s->bind (p->first.c_str ());
|
||||
s->close ();
|
||||
}
|
||||
|
||||
slot_sync.lock ();
|
||||
if (!starting) {
|
||||
|
||||
@ -108,13 +116,6 @@ int zmq::ctx_t::terminate ()
|
||||
term_mailbox.forked();
|
||||
}
|
||||
#endif
|
||||
// Connect up any pending inproc connections, otherwise we will hang
|
||||
pending_connections_t copy = pending_connections;
|
||||
for (pending_connections_t::iterator p = copy.begin (); p != copy.end (); ++p) {
|
||||
zmq::socket_base_t *s = create_socket (ZMQ_PAIR);
|
||||
s->bind (p->first.c_str ());
|
||||
s->close ();
|
||||
}
|
||||
|
||||
// Check whether termination was already underway, but interrupted and now
|
||||
// restarted.
|
||||
|
Loading…
x
Reference in New Issue
Block a user