Package ghidra.util.worker
Class PriorityWorker
Executes a single job at a time in priority order.
- See Also:
-
Constructor Summary
ConstructorDescriptionPriorityWorker
(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 TypeMethodDescriptionvoid
schedule
(PriorityJob job) Schedules the job for execution.Methods inherited from class ghidra.util.worker.AbstractWorker
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:AbstractWorker
Schedules the job for execution. Jobs will be processed 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)- Overrides:
schedule
in classAbstractWorker<PriorityJob>
- Parameters:
job
- the job to be executed.
-