public void push(Job<T> job) throws InterruptedException { _push(new QueueTask<>(QueueTask.ActionType.Normal, job)); checkWorkforce(); }
public Job(String jobTile, Task<T> task) { mJobTitle = jobTile; mTask = task; mBooleanLatch = new BooleanLatch(); }
@Override protected boolean tryReleaseShared(int ignore) { setState(1); return true; } }
@Override public void runTask(@NonNull Job<Void> job) throws Exception { job.runTask(new JobContext<>(null /* payload */)); job.finished(); } }
private synchronized void reduceWorkforce() throws InterruptedException { verbose("Decrementing workforce from " + mWorkThreads.size()); // push a the right number of kiss of death tasks to shutdown threads. for (int i = 0; i < mMWorkforceIncrement; i++) { _push(new QueueTask<>(QueueTask.ActionType.Death, null)); } }
ProcessRecorder(@NonNull ExecutionRecordWriter outWriter, @NonNull ILogger iLogger) { this.singletonJobContext = new JobContext<ExecutionRecordWriter>(outWriter); workQueue = new WorkQueue<ExecutionRecordWriter>( iLogger, new WorkQueueContext(), "execRecordWriter", 1); }
static void push(Job<Void> job) throws InterruptedException { WORK_QUEUE.push(job); } }
public void await() throws InterruptedException { sync.acquireSharedInterruptibly(1); } public boolean await(long nanosTimeout) throws InterruptedException {
@Override protected int tryAcquireShared(int ignore) { return isSignalled() ? 1 : -1; }
/** * Done with the recording processing, finish processing the outstanding {@link ExecutionRecord} * publication and shutdowns the processing queue. * * @throws InterruptedException */ void finish() throws InterruptedException { workQueue.shutdown(); }
public boolean await(long nanosTimeout) throws InterruptedException { return sync.tryAcquireSharedNanos(1, nanosTimeout); }
public void signal() { sync.releaseShared(1); } public void await() throws InterruptedException {
public void finished() { task.finished(); }
@Override public void runTask(@NonNull Job<Void> job) throws Exception { job.runTask(new JobContext<Void>(null /* payload */)); job.finished(); } }
public void push(Job<T> job) throws InterruptedException { _push(new QueueTask<T>(QueueTask.ActionType.Normal, job)); checkWorkforce(); }
private synchronized void reduceWorkforce() throws InterruptedException { verbose("Decrementing workforce from " + mWorkThreads.size()); // push a the right number of kiss of death tasks to shutdown threads. for (int i = 0; i < mMWorkforceIncrement; i++) { _push(new QueueTask<T>(QueueTask.ActionType.Death, null)); } }
public static void push(Job<Void> job) throws InterruptedException { WORK_QUEUE.push(job); } }
@Override protected boolean tryReleaseShared(int ignore) { setState(1); return true; } }
public void await() throws InterruptedException { sync.acquireSharedInterruptibly(1); } public boolean await(long nanosTimeout) throws InterruptedException {
@Override protected int tryAcquireShared(int ignore) { return isSignalled() ? 1 : -1; }