From 235ed3a3dcffb7c658cbc9253eae9de54db24533 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Tue, 4 May 2010 10:22:16 +0200 Subject: signaler transports commands per se rather than one-bit signals --- src/app_thread.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/app_thread.cpp') diff --git a/src/app_thread.cpp b/src/app_thread.cpp index bd5f5e3..1c06337 100644 --- a/src/app_thread.cpp +++ b/src/app_thread.cpp @@ -82,9 +82,12 @@ zmq::signaler_t *zmq::app_thread_t::get_signaler () bool zmq::app_thread_t::process_commands (bool block_, bool throttle_) { - uint32_t signal; - if (block_) - signal = signaler.poll (); + bool received; + command_t cmd; + if (block_) { + received = signaler.recv (&cmd, true); + zmq_assert (received); + } else { #if defined ZMQ_DELAY_COMMANDS @@ -117,15 +120,12 @@ bool zmq::app_thread_t::process_commands (bool block_, bool throttle_) #endif // Check whether there are any commands pending for this thread. - signal = signaler.check (); + received = signaler.recv (&cmd, false); } - // Process all the commands from the signaling source if there is one. - if (signal != signaler_t::no_signal) { - command_t cmd; - while (get_dispatcher ()->read (signal, get_thread_slot (), &cmd)) - cmd.destination->process_command (cmd); - } + // Process the command, if any. + if (received) + cmd.destination->process_command (cmd); return !terminated; } -- cgit v1.2.3