mirror of
https://github.com/jneug/zeichenmaschine.git
synced 2026-04-14 06:33:34 +02:00
DelayedTask wartet selbstständig
This commit is contained in:
@@ -46,14 +46,14 @@ public abstract class DelayedTask extends Task implements Delayed {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
long delay = getDelay(TimeUnit.MILLISECONDS);
|
||||
while( delay > 0 ) {
|
||||
while( getDelay(TimeUnit.MILLISECONDS) > 0 ) {
|
||||
try {
|
||||
wait(delay);
|
||||
System.out.println("Waiting for " + getDelay(TimeUnit.MILLISECONDS) + " ms");
|
||||
Thread.sleep(getDelay(TimeUnit.MILLISECONDS));
|
||||
//wait(getDelay(TimeUnit.MILLISECONDS));
|
||||
} catch( InterruptedException e ) {
|
||||
// Keep waiting
|
||||
}
|
||||
delay = getDelay(TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
running = true;
|
||||
|
||||
Reference in New Issue
Block a user