#define DBL 10
+#include <sstream>
#include <signal.h>
#include <sys/time.h>
#include <math.h>
if (i == scheduled.begin())
cond.Signal();
+ dout(19) << show_all_events(__func__) << dendl;
lock.Unlock();
}
{
dout(DBL) << __PRETTY_FUNCTION__ << dendl;
+ dout(19) << show_all_events(__func__) << dendl;
+
lock.Lock();
cancel_all_events_impl(false);
lock.Unlock();
bool Timer::cancel_event_impl(Context *callback, bool cancel_running)
{
+ dout(19) << show_all_events(__func__) << dendl;
+
event_lookup_map_t::iterator e = events.find(callback);
if (e != events.end()) {
// Erase the item out of the scheduled map.
}
}
+std::string Timer::show_all_events(const char *caller) const
+{
+ ostringstream oss;
+ string sep;
+ oss << "show_all_events: from " << caller << ": scheduled [";
+ for (scheduled_map_t::const_iterator s = scheduled.begin();
+ s != scheduled.end();
+ ++s)
+ {
+ oss << sep << s->first << "->" << s->second;
+ sep = ",";
+ }
+ oss << "] ";
+
+ oss << "events [";
+ string sep2;
+ for (event_lookup_map_t::const_iterator e = events.begin();
+ e != events.end();
+ ++e)
+ {
+ oss << sep2 << e->first << "->" << e->second->first;
+ sep2 = ",";
+ }
+ oss << "]";
+ return oss.str();
+}
+
/******************************************************************/
SafeTimer::SafeTimer(Mutex &event_lock)
: t(&event_lock)
void pop_running(std::list <Context*> &running_, const utime_t &now);
+ std::string show_all_events(const char *caller) const;
+
// This class isn't supposed to be copied
Timer(const Timer &rhs);
Timer& operator=(const Timer &rhs);