common base for all pollers created; the only thing it handles at the moment is 'load'

This commit is contained in:
Martin Sustrik
2010-09-26 19:22:33 +02:00
parent cf815e8c78
commit 8d7bf6684c
13 changed files with 125 additions and 86 deletions

View File

@@ -54,9 +54,6 @@ zmq::poll_t::poll_t () :
zmq::poll_t::~poll_t ()
{
worker.stop ();
// Make sure there are no fds registered on shutdown.
zmq_assert (load.get () == 0);
}
zmq::poll_t::handle_t zmq::poll_t::add_fd (fd_t fd_, i_poll_events *events_)
@@ -69,7 +66,7 @@ zmq::poll_t::handle_t zmq::poll_t::add_fd (fd_t fd_, i_poll_events *events_)
fd_table [fd_].events = events_;
// Increase the load metric of the thread.
load.add (1);
adjust_load (1);
return fd_;
}
@@ -85,7 +82,7 @@ void zmq::poll_t::rm_fd (handle_t handle_)
retired = true;
// Decrease the load metric of the thread.
load.sub (1);
adjust_load (-1);
}
void zmq::poll_t::set_pollin (handle_t handle_)
@@ -124,11 +121,6 @@ void zmq::poll_t::cancel_timer (i_poll_events *events_, int id_)
timers.erase (it);
}
int zmq::poll_t::get_load ()
{
return load.get ();
}
void zmq::poll_t::start ()
{
worker.start (worker_routine, this);