prevent re-schedule of cancelled TimerTask

This commit is contained in:
Guenter Obiltschnig
2014-11-24 18:38:05 +01:00
parent 42c814cca4
commit c2edf4470f
3 changed files with 21 additions and 2 deletions

View File

@@ -154,7 +154,8 @@ public:
protected:
void run();
static void validateTask(const TimerTask::Ptr& pTask);
private:
Timer(const Timer&);
Timer& operator = (const Timer&);

View File

@@ -50,7 +50,10 @@ public:
/// not yet run, or has not yet been scheduled, it will never run.
/// If the task has been scheduled for repeated execution, it will never
/// run again. If the task is running when this call occurs, the task
/// will run to completion, but will never run again.
/// will run to completion, but will never run again.
///
/// Warning: A TimerTask that has been cancelled must not be scheduled again.
/// An attempt to do so results in a Poco::Util::IllegalStateException being thrown.
bool isCancelled() const;
/// Returns true iff the TimerTask has been cancelled by a call