]> Dogcows Code - chaz/yoink/blobdiff - src/moof/runloop.hh
further implementing runloop support
[chaz/yoink] / src / moof / runloop.hh
index 0aad06dddaa9a25c82fc2f9d1e17c2c4af3d5667..f70abdef3891bf3b687633f71380099c677790cf 100644 (file)
@@ -17,7 +17,7 @@
  * Thread timer management class.
  */
 
-#include <set>
+#include <vector>
 
 #include <boost/noncopyable.hpp>
 
@@ -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*> timer_table;
+       typedef std::vector<timer*> timer_table;
        timer_table     timers_;
        timer_table::iterator timers_it_;
 
This page took 0.019541 seconds and 4 git commands to generate.