0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-31 01:43:02 +08:00

synchronisation problem fixed in ctx_t

This commit is contained in:
Martin Sustrik 2010-09-19 21:40:26 +02:00
parent 471013a59f
commit 938689a491
2 changed files with 6 additions and 1 deletions

View File

@ -108,8 +108,10 @@ int zmq::ctx_t::terminate ()
{
// First send stop command to sockets so that any
// blocking calls are interrupted.
slot_sync.lock ();
for (sockets_t::size_type i = 0; i != sockets.size (); i++)
sockets [i]->stop ();
slot_sync.unlock ();
// Close the logging infrastructure.
log_sync.lock ();

View File

@ -139,7 +139,10 @@ void zmq::zmq_init_t::finalise_initialisation ()
if (sent && received) {
// If we know what session we belong to, it's easy, just send the
// engine to that session and destroy the init object.
// engine to that session and destroy the init object. Note that we
// know about the session only if this object is owned by it. Thus,
// lifetime of this object in contained in the lifetime of the session
// so the pointer cannot become invalid without notice.
if (session) {
engine->unplug ();
send_attach (session, engine, peer_identity, true);