mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Minor: specify time unit in alarm
This commit is contained in:
+6
-5
@@ -21,20 +21,21 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class SingleAlarmWithMutableDelay extends Alarm {
|
||||
private final Runnable myTask;
|
||||
private volatile int myDelay;
|
||||
private volatile int myDelayMillis;
|
||||
|
||||
public SingleAlarmWithMutableDelay(@NotNull Runnable task, @NotNull Disposable parentDisposable) {
|
||||
super(ThreadToUse.POOLED_THREAD, parentDisposable);
|
||||
myTask = task;
|
||||
}
|
||||
|
||||
public void setDelay(int value) {
|
||||
myDelay = value;
|
||||
public void setDelay(int millis) {
|
||||
myDelayMillis = millis;
|
||||
}
|
||||
|
||||
public void cancelAndRequest() {
|
||||
if(!isDisposed()) {
|
||||
if (!isDisposed()) {
|
||||
cancelAllRequests();
|
||||
addRequest(myTask, myDelay);
|
||||
addRequest(myTask, myDelayMillis);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user