diff options
author | malosek <malosek@fastmq.com> | 2009-10-05 10:22:31 +0200 |
---|---|---|
committer | malosek <malosek@fastmq.com> | 2009-10-05 10:22:31 +0200 |
commit | d57ee0984ac3f8712063a7f83d7200be25ca5513 (patch) | |
tree | a956443e70c48ebd21242c11cc015db61c53c682 /src/poll.cpp | |
parent | ff65e26ce7567ea6a907e566f8530f4988231d68 (diff) | |
parent | 4efe2366d7394e8969fc9aa64c50be6842d8455f (diff) |
Merge branch 'master' of git@github.com:sustrik/zeromq2
Diffstat (limited to 'src/poll.cpp')
-rw-r--r-- | src/poll.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/poll.cpp b/src/poll.cpp index dd3de43..50a2426 100644 --- a/src/poll.cpp +++ b/src/poll.cpp @@ -58,7 +58,7 @@ zmq::poll_t::~poll_t () zmq_assert (load.get () == 0); } -zmq::handle_t zmq::poll_t::add_fd (fd_t fd_, i_poll_events *events_) +zmq::poll_t::handle_t zmq::poll_t::add_fd (fd_t fd_, i_poll_events *events_) { pollfd pfd = {fd_, 0, 0}; pollset.push_back (pfd); @@ -70,19 +70,17 @@ zmq::handle_t zmq::poll_t::add_fd (fd_t fd_, i_poll_events *events_) // Increase the load metric of the thread. load.add (1); - handle_t handle; - handle.fd = fd_; - return handle; + return fd_; } void zmq::poll_t::rm_fd (handle_t handle_) { - fd_t index = fd_table [handle_.fd].index; + fd_t index = fd_table [handle_].index; assert (index != retired_fd); // Mark the fd as unused. pollset [index].fd = retired_fd; - fd_table [handle_.fd].index = retired_fd; + fd_table [handle_].index = retired_fd; retired = true; // Decrease the load metric of the thread. @@ -91,25 +89,25 @@ void zmq::poll_t::rm_fd (handle_t handle_) void zmq::poll_t::set_pollin (handle_t handle_) { - int index = fd_table [handle_.fd].index; + int index = fd_table [handle_].index; pollset [index].events |= POLLIN; } void zmq::poll_t::reset_pollin (handle_t handle_) { - int index = fd_table [handle_.fd].index; + int index = fd_table [handle_].index; pollset [index].events &= ~((short) POLLIN); } void zmq::poll_t::set_pollout (handle_t handle_) { - int index = fd_table [handle_.fd].index; + int index = fd_table [handle_].index; pollset [index].events |= POLLOUT; } void zmq::poll_t::reset_pollout (handle_t handle_) { - int index = fd_table [handle_.fd].index; + int index = fd_table [handle_].index; pollset [index].events &= ~((short) POLLOUT); } |