From 2df873a435ff139cf9d1b10b666d75e6dc6da442 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Thu, 16 Feb 2012 10:05:01 +0900 Subject: Timers identified by dynamically generated handles Timers are not longer identified by hard-wired IDs. Signed-off-by: Martin Sustrik --- src/io_object.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/io_object.cpp') diff --git a/src/io_object.cpp b/src/io_object.cpp index 730123e..abc8204 100644 --- a/src/io_object.cpp +++ b/src/io_object.cpp @@ -82,14 +82,14 @@ void xs::io_object_t::reset_pollout (handle_t handle_) poller->reset_pollout (handle_); } -void xs::io_object_t::add_timer (int timeout_, int id_) +xs::handle_t xs::io_object_t::add_timer (int timeout_) { - poller->add_timer (timeout_, this, id_); + return poller->add_timer (timeout_, this); } -void xs::io_object_t::rm_timer (int id_) +void xs::io_object_t::rm_timer (handle_t handle_) { - poller->rm_timer (this, id_); + poller->rm_timer (handle_); } void xs::io_object_t::in_event (fd_t fd_) @@ -98,11 +98,12 @@ void xs::io_object_t::in_event (fd_t fd_) } void xs::io_object_t::out_event (fd_t fd_) + { xs_assert (false); } -void xs::io_object_t::timer_event (int id_) +void xs::io_object_t::timer_event (handle_t handle_) { xs_assert (false); } -- cgit v1.2.3