summaryrefslogtreecommitdiff
path: root/src/zmq_listener.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2010-09-09 08:25:00 +0200
committerMartin Sustrik <sustrik@250bpm.com>2010-09-09 08:25:00 +0200
commita68e6739f4248e25a0f9a64c89729f55dfacb842 (patch)
tree4686061e52137cfa373587162f59536cd3f55d32 /src/zmq_listener.cpp
parent47e87b7e4b8dd6a0cfbc1f30ffcb06edfa83c853 (diff)
when no I/O threads are available error is raised instead of assertion
Diffstat (limited to 'src/zmq_listener.cpp')
-rw-r--r--src/zmq_listener.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/zmq_listener.cpp b/src/zmq_listener.cpp
index 4569ac1..78e44e6 100644
--- a/src/zmq_listener.cpp
+++ b/src/zmq_listener.cpp
@@ -64,9 +64,14 @@ void zmq::zmq_listener_t::in_event ()
if (fd == retired_fd)
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 and launch an init object.
- zmq_init_t *init = new (std::nothrow) zmq_init_t (
- choose_io_thread (options.affinity), socket, NULL, fd, options);
+ zmq_init_t *init = new (std::nothrow) zmq_init_t (io_thread, socket,
+ NULL, fd, options);
zmq_assert (init);
launch_sibling (init);
}