diff options
Diffstat (limited to 'cpp/src/qpid/broker/Timer.cpp')
| -rw-r--r-- | cpp/src/qpid/broker/Timer.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cpp/src/qpid/broker/Timer.cpp b/cpp/src/qpid/broker/Timer.cpp index 0b0d3ba63d..46bbdbb574 100644 --- a/cpp/src/qpid/broker/Timer.cpp +++ b/cpp/src/qpid/broker/Timer.cpp @@ -38,6 +38,9 @@ TimerTask::~TimerTask(){} void TimerTask::reset() { time = AbsTime(AbsTime::now(), duration); } +void TimerTask::cancel() { cancelled = true; } +bool TimerTask::isCancelled() const { return cancelled; } + Timer::Timer() : active(false) { start(); @@ -56,7 +59,7 @@ void Timer::run() monitor.wait(); } else { intrusive_ptr<TimerTask> t = tasks.top(); - if (t->cancelled) { + if (t->isCancelled()) { tasks.pop(); } else if(t->time < AbsTime::now()) { tasks.pop(); |
