mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 03:50:02 +02:00
Merge remote-tracking branch 'origin/patch'
Conflicts: Ghidra/Framework/Docking/src/main/java/ghidra/util/task/TaskDialog.java Ghidra/Framework/Docking/src/main/java/ghidra/util/task/TaskRunner.java Ghidra/Framework/Generic/src/main/java/ghidra/util/timer/GTimer.java
This commit is contained in:
commit
fa18866fa8
19 changed files with 296 additions and 278 deletions
|
@ -27,7 +27,7 @@ import ghidra.util.Msg;
|
|||
*/
|
||||
public class GTimer {
|
||||
private static Timer timer;
|
||||
private static GTimerMonitor DO_NOTHING_MONITOR = new DoNothingMonitor();
|
||||
private static GTimerMonitor DO_NOTHING_MONITOR = GTimerMonitor.DUMMY;
|
||||
|
||||
/**
|
||||
* Schedules a runnable for execution after the specified delay. A delay value less than 0
|
||||
|
@ -77,24 +77,6 @@ public class GTimer {
|
|||
return timer;
|
||||
}
|
||||
|
||||
static class DoNothingMonitor implements GTimerMonitor {
|
||||
@Override
|
||||
public boolean cancel() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean didRun() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wasCancelled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static class GTimerTask extends TimerTask implements GTimerMonitor {
|
||||
|
||||
private final Runnable runnable;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
/* ###
|
||||
* IP: GHIDRA
|
||||
* REVIEWED: YES
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -17,10 +16,32 @@
|
|||
package ghidra.util.timer;
|
||||
|
||||
/**
|
||||
* Monitor object returned from a GTimer.schedule() call
|
||||
*
|
||||
* Monitor object returned from a GTimer.schedule() call
|
||||
*/
|
||||
public interface GTimerMonitor {
|
||||
|
||||
/**
|
||||
* A dummy implementation of this interface
|
||||
*/
|
||||
public static GTimerMonitor DUMMY =
|
||||
new GTimerMonitor() {
|
||||
|
||||
@Override
|
||||
public boolean wasCancelled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean didRun() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean cancel() {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Cancels the scheduled runnable associated with this GTimerMonitor if it has not already run.
|
||||
* @return true if the scheduled runnable was cancelled before it had a chance to execute.
|
||||
|
@ -35,7 +56,7 @@ public interface GTimerMonitor {
|
|||
|
||||
/**
|
||||
* Return true if the scheduled runnable was cancelled before it had a chance to run.
|
||||
* @return
|
||||
* @return true if the scheduled runnable was cancelled before it had a chance to run.
|
||||
*/
|
||||
public boolean wasCancelled();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue