X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2Fmoof%2Frunloop.hh;h=f70abdef3891bf3b687633f71380099c677790cf;hp=0aad06dddaa9a25c82fc2f9d1e17c2c4af3d5667;hb=af88821a172c4dfd138b91b2a5148ae50b502fa2;hpb=d6990468d297a6cbee98e4d0d33ab37e1b2352c9 diff --git a/src/moof/runloop.hh b/src/moof/runloop.hh index 0aad06d..f70abde 100644 --- a/src/moof/runloop.hh +++ b/src/moof/runloop.hh @@ -17,7 +17,7 @@ * Thread timer management class. */ -#include +#include #include @@ -35,7 +35,7 @@ class timer; /** * A runloop is a loop with scheduled timers. */ -class runloop +class runloop : public boost::noncopyable { public: @@ -43,8 +43,12 @@ public: * Construct a runloop. */ runloop() : - stop_(false), - thread_id_(0) {} + stop_(false) + { +#if ENABLE_THREADS + thread_id_ = 0; +#endif + } /** * Deconstruct the runloop. @@ -72,18 +76,16 @@ public: static runloop* current(); -private: + void add_timer(timer& timer); + void remove_timer(timer& timer); - friend class timer; - - void add_timer(timer* timer); - void remove_timer(timer* timer); +private: bool stop_; int code_; - typedef std::set timer_table; + typedef std::vector timer_table; timer_table timers_; timer_table::iterator timers_it_;