mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-21 02:00:36 +01:00
Rewrite event processing in io_thread
This commit is contained in:
parent
823d14c7fc
commit
e37814eca4
@ -67,20 +67,16 @@ void zmq::io_thread_t::in_event ()
|
||||
// TODO: Do we want to limit number of commands I/O thread can
|
||||
// process in a single go?
|
||||
|
||||
while (true) {
|
||||
command_t cmd;
|
||||
int rc = mailbox.recv (&cmd, 0);
|
||||
|
||||
// Get the next command. If there is none, exit.
|
||||
command_t cmd;
|
||||
int rc = mailbox.recv (&cmd, 0);
|
||||
if (rc != 0 && errno == EINTR)
|
||||
continue;
|
||||
if (rc != 0 && errno == EAGAIN)
|
||||
break;
|
||||
errno_assert (rc == 0);
|
||||
|
||||
// Process the command.
|
||||
cmd.destination->process_command (cmd);
|
||||
while (rc == 0 || errno == EINTR) {
|
||||
if (rc == 0)
|
||||
cmd.destination->process_command (cmd);
|
||||
rc = mailbox.recv (&cmd, 0);
|
||||
}
|
||||
|
||||
errno_assert (rc != 0 && errno == EAGAIN);
|
||||
}
|
||||
|
||||
void zmq::io_thread_t::out_event ()
|
||||
|
Loading…
x
Reference in New Issue
Block a user