]>
Dogcows Code - chaz/yoink/blob - src/moof/runloop.hh
2 /*] Copyright (c) 2009-2010, Charles McGarvey [**************************
3 **] All rights reserved.
7 * Distributable under the terms and conditions of the 2-clause BSD license;
8 * see the file COPYING for a complete text of the license.
10 **************************************************************************/
12 #ifndef _MOOF_RUNLOOP_HH_
13 #define _MOOF_RUNLOOP_HH_
17 * Thread timer management class.
22 #include <boost/noncopyable.hpp>
24 #include <moof/backend.hh>
25 #include <moof/thread.hh>
31 // forward declarations
36 * A runloop is a loop with scheduled timers.
38 class runloop
: public boost::noncopyable
43 * Construct a runloop.
54 * Deconstruct the runloop.
60 * Start running the runloop.
61 * \return The exit code.
67 * \param code The exit code.
69 void stop(int code
= 0);
72 /** Get the runloop of the current thread.
73 * \return The current runloop or 0 if none is running in the current
76 static runloop
* current();
79 void add_timer(timer
& timer
);
80 void remove_timer(timer
& timer
);
88 typedef std::vector
<timer
*> timer_table
;
90 timer_table::iterator timers_it_
;
93 MOOF_DECLARE_MUTEX(timers_mutex_
);
104 #endif // _MOOF_RUNLOOP_HH_
This page took 0.036125 seconds and 4 git commands to generate.