Commit Graph

9 Commits

Author SHA1 Message Date
Colin Patrick McCabe
571e3750c6 SafeTimer: clean up copy constructor declaration
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
2010-11-03 21:40:23 -07:00
Colin Patrick McCabe
e6b8dbae9f Timer: fix timer shutdown, efficiency issues
Rework Timer and SafeTimer to be more efficient and to handle shutdown
correctly. Document the API, especially what locks need to held where.

The destructor for both Timer and SafeTimer now joins the timer thread
safely. The shutdown() function is available to callers who want to join
it before the Timer is destroyed.

To make things more efficient, don't create a new std::set every time we
insert a Context. Use multimap instead. Don't signal the condition
variable unless the event we have insert comes before all the other
events in the scheduled map. Don't allocate an extra Context in
SafeTimer.

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
2010-11-03 21:40:23 -07:00
Markus Elfring
f4b9d9d847 Bug #98: Unique names for include guards
A couple of preprocessor symbols for include guards tampered with the reserved namespace.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Sage Weil <sage@newdream.net>
2010-06-17 10:47:37 -07:00
Sage Weil
e976c53607 timer: kill unused g_timer 2010-03-09 14:51:05 -08:00
Yehuda Sadeh
b5860ee361 common: virtual destructor for class Timer 2009-02-19 15:43:16 -08:00
Yehuda Sadeh
740da72fbd SafeTimer: getting rid of global timer 2009-02-19 15:25:11 -08:00
Sage Weil
681e6d13eb timer: discard unfired events on shutdown
Mostly this just cleans up valgrind leak check output.
2008-11-26 10:55:14 -08:00
Sage Weil
1a51eb97d5 lockdep: annotate Mutex declarations 2008-10-31 16:51:50 -07:00
Sage Weil
c1865445c5 reorganized source tree 2007-12-19 13:28:33 -08:00