Package ghidra.util.worker
Class PriorityWorker
Executes a single job at a time in priority order.
The highest priority jobs are those with the lowest value return by the job's getPriority() method. (i.e. the job with priority 0 will be processed before the job with priority 1)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPriorityWorker(String name, boolean isPersistentThread, boolean useSharedThreadPool, TaskMonitor monitor) This constructor allows you to change persistence and shared thread pool usage.PriorityWorker(String name, TaskMonitor monitor) Creates a PriorityWorker that will use a shared thread pool to process jobs. -
Method Summary
Modifier and TypeMethodDescriptionvoidschedule(PriorityJob job) Schedules the job for execution.Methods inherited from class ghidra.util.worker.AbstractWorker
clearAllJobs, clearAllJobs, clearAllJobsWithInterrupt_IKnowTheRisks, clearPendingJobs, dispose, isBusy, isDisposed, setBusyListener, setTaskMonitor, waitUntilNoJobsScheduled
-
Constructor Details
-
PriorityWorker
Creates a PriorityWorker that will use a shared thread pool to process jobs. Also, threads created using this constructor are not persistent.- Parameters:
name- the name of the shared thread pool.monitor- the monitor used to cancel jobs.
-
PriorityWorker
public PriorityWorker(String name, boolean isPersistentThread, boolean useSharedThreadPool, TaskMonitor monitor) This constructor allows you to change persistence and shared thread pool usage.- Parameters:
name- the name of the shared thread pool.isPersistentThread- if true, the worker thread will stay around when idle; false means that the thread will go away if not needed. Should be true for high frequency usage.useSharedThreadPool- true signals to use the given name to find/create a thread pool that can be shared throughout the system.monitor- the monitor used to cancel jobs.
-
-
Method Details
-
schedule
Description copied from class:AbstractWorkerSchedules the job for execution. Jobs will be processed according to the queue supplied at construction time (e.g., in priority order or 1 at a time).- Overrides:
schedulein classAbstractWorker<PriorityJob>- Parameters:
job- the job to be executed.
-