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/monitor.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/monitor.hpp') diff --git a/src/monitor.hpp b/src/monitor.hpp index 8aa58ba..73bc31c 100644 --- a/src/monitor.hpp +++ b/src/monitor.hpp @@ -47,19 +47,20 @@ namespace xs private: - enum {timer_id = 0x44}; - // Handlers for incoming commands. void process_plug (); void process_stop (); // Events from the poller. - void timer_event (int id_); + void timer_event (handle_t handle_); // Actual monitoring data to send and the related critical section. std::string text; mutex_t sync; + // Handle of the timer. + handle_t timer; + monitor_t (const monitor_t&); const monitor_t &operator = (const monitor_t&); }; -- cgit v1.2.3