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
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
long delay = getDelay(TimeUnit.MILLISECONDS);
|
while( getDelay(TimeUnit.MILLISECONDS) > 0 ) {
|
||||||
while( delay > 0 ) {
|
|
||||||
try {
|
try {
|
||||||
wait(delay);
|
System.out.println("Waiting for " + getDelay(TimeUnit.MILLISECONDS) + " ms");
|
||||||
|
Thread.sleep(getDelay(TimeUnit.MILLISECONDS));
|
||||||
|
//wait(getDelay(TimeUnit.MILLISECONDS));
|
||||||
} catch( InterruptedException e ) {
|
} catch( InterruptedException e ) {
|
||||||
// Keep waiting
|
// Keep waiting
|
||||||
}
|
}
|
||||||
delay = getDelay(TimeUnit.MILLISECONDS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
running = true;
|
running = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user