view dwtx/dwtxhelper/TimerTask.d @ 200:eb3414669eb0 default tip

fix for dmd 1.041 and tango 0.99.8
author Frank Benoit <benoit@tionex.de>
date Sat, 28 Mar 2009 03:09:57 +0100
parents 987b95661bb9
children
line wrap: on
line source

module dwtx.dwtxhelper.TimerTask;

import tango.time.Time;
import dwt.dwthelper.utils;
import dwt.dwthelper.Runnable;
import dwtx.dwtxhelper.Timer;

class TimerTask : Runnable {

    package long scheduled;
    package long lastExecutionTime;
    package long period;
    package bool fixed;

    this(){
        this.scheduled = 0;
        this.lastExecutionTime = -1;
    }

    bool cancel(){
        bool prevented_execution = (this.scheduled >= 0);
        this.scheduled = -1;
        return prevented_execution;
    }

    abstract void run();

    long scheduledExcecutionTime(){
        return lastExecutionTime;
    }
}