GT-3542 - Symbol Tree - fixed flashing of the symbol tree while

analyzing; fixed bad progress of Decompiler Parameter ID analyzer; fixed
odd progress updating of ConcurrentQ
This commit is contained in:
dragonmacher 2020-03-20 12:56:56 -04:00
parent e9ac056f90
commit 30db29d1ce
12 changed files with 98 additions and 58 deletions

View file

@ -15,25 +15,26 @@
*/
package generic.concurrent;
import java.util.Set;
import ghidra.util.graph.AbstractDependencyGraph;
import ghidra.util.task.TaskMonitor;
import java.util.Set;
public class ConcurrentGraphQ<I> {
private ConcurrentQ<I, Object> queue;
private AbstractDependencyGraph<I> graph;
public ConcurrentGraphQ(QRunnable<I> runnable, AbstractDependencyGraph<I> graph, GThreadPool pool,
public ConcurrentGraphQ(QRunnable<I> runnable, AbstractDependencyGraph<I> graph,
GThreadPool pool,
TaskMonitor monitor) {
this.graph = graph;
// @formatter:off
queue = new ConcurrentQBuilder<I, Object>()
.setCollectResults(false)
.setThreadPool(pool)
.setThreadPool(pool)
.setMonitor(monitor)
.setListener(new MyItemListener())
.build(new QRunnableAdapter<I>(runnable));
.build(new QRunnableAdapter<>(runnable));
// @formatter:on
}

View file

@ -791,7 +791,17 @@ public class ConcurrentQ<I, R> {
@Override
public void taskEnded(long id, I Item, long total, long progress) {
if (!jobsReportProgress) {
if (total != monitor.getMaximum()) {
//
// This code works in 2 ways. The default case is that clients place items on
// the queue. As the amount of work grows, so too does the max progress value.
// This obviates the need for clients to manager progress. (The downside to this
// is that the progress may keep getting pushed back as it approaches the
// current maximum value.) The second case is where the client has specified a
// true maximum value. In that case, this code will not change the maxmimum
// (assuming that the client does not put more items into the queue than they
// specified).
//
if (total > monitor.getMaximum()) {
monitor.setMaximum(total);
}
monitor.setProgress(progress);