mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-30 09:45:56 +08:00
Merge remote-tracking branch 'origin/patch'
This commit is contained in:
@@ -38,7 +38,7 @@ public class PyGhidraTaskMonitor implements TaskMonitor {
|
|||||||
private boolean isIndeterminate;
|
private boolean isIndeterminate;
|
||||||
private volatile boolean isCancelled;
|
private volatile boolean isCancelled;
|
||||||
|
|
||||||
private Timer timer = new Timer();
|
private Timer timer;
|
||||||
private WeakSet<CancelledListener> listeners =
|
private WeakSet<CancelledListener> listeners =
|
||||||
WeakDataStructureFactory.createCopyOnReadWeakSet();
|
WeakDataStructureFactory.createCopyOnReadWeakSet();
|
||||||
private TriConsumer<String, Long, Long> changeCallback;
|
private TriConsumer<String, Long, Long> changeCallback;
|
||||||
@@ -55,6 +55,7 @@ public class PyGhidraTaskMonitor implements TaskMonitor {
|
|||||||
TriConsumer<String, Long, Long> changeCallback) {
|
TriConsumer<String, Long, Long> changeCallback) {
|
||||||
isCancelled = false;
|
isCancelled = false;
|
||||||
if (timeoutSecs != null) {
|
if (timeoutSecs != null) {
|
||||||
|
timer = new Timer(true);
|
||||||
timer.schedule(new PyGhidraTimeOutTask(), timeoutSecs * 1000);
|
timer.schedule(new PyGhidraTimeOutTask(), timeoutSecs * 1000);
|
||||||
}
|
}
|
||||||
this.changeCallback = changeCallback;
|
this.changeCallback = changeCallback;
|
||||||
@@ -143,7 +144,9 @@ public class PyGhidraTaskMonitor implements TaskMonitor {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void cancel() {
|
public void cancel() {
|
||||||
timer.cancel(); // Terminate the timer thread
|
if (timer != null) {
|
||||||
|
timer.cancel(); // Terminate the timer thread
|
||||||
|
}
|
||||||
isCancelled = true;
|
isCancelled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user