]>
Dogcows Code - chaz/yoink/blob - runloop.hh
0aad06dddaa9a25c82fc2f9d1e17c2c4af3d5667
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.
43 * Construct a runloop.
50 * Deconstruct the runloop.
56 * Start running the runloop.
57 * \return The exit code.
63 * \param code The exit code.
65 void stop(int code
= 0);
68 /** Get the runloop of the current thread.
69 * \return The current runloop or 0 if none is running in the current
72 static runloop
* current();
79 void add_timer(timer
* timer
);
80 void remove_timer(timer
* timer
);
86 typedef std::set
<timer
*> timer_table
;
88 timer_table::iterator timers_it_
;
91 MOOF_DECLARE_MUTEX(timers_mutex_
);
102 #endif // _MOOF_RUNLOOP_HH_
This page took 0.040198 seconds and 3 git commands to generate.