From a68e6739f4248e25a0f9a64c89729f55dfacb842 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Thu, 9 Sep 2010 08:25:00 +0200 Subject: when no I/O threads are available error is raised instead of assertion --- src/zmq_connecter.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/zmq_connecter.cpp') diff --git a/src/zmq_connecter.cpp b/src/zmq_connecter.cpp index 8f8fae2..cfca875 100644 --- a/src/zmq_connecter.cpp +++ b/src/zmq_connecter.cpp @@ -77,9 +77,14 @@ void zmq::zmq_connecter_t::out_event () return; } + // Choose I/O thread to run connecter in. Given that we are already + // running in an I/O thread, there must be at least one available. + io_thread_t *io_thread = choose_io_thread (options.affinity); + zmq_assert (io_thread); + // Create an init object. - zmq_init_t *init = new (std::nothrow) zmq_init_t ( - choose_io_thread (options.affinity), NULL, session, fd, options); + zmq_init_t *init = new (std::nothrow) zmq_init_t (io_thread, NULL, + session, fd, options); zmq_assert (init); launch_sibling (init); -- cgit v1.2.3