@Override protected void onCriteriaMet() { // on behalf of the member Executors, // the one that executes the main thing will send notifications // Unclear if this will work with AsynchronousExecution; it *seems* this is only called from synchronize which is only called from synchronizeStart which is only called from an executor thread. Executor e = Executor.currentExecutor(); if (e.getCurrentWorkUnit().isMainWork()) { e.getOwner().taskAccepted(e,task); } } };
/** * All the {@link Executor}s that jointly execute a {@link Task} call this method to synchronize on the start. */ public void synchronizeStart() throws InterruptedException { startLatch.synchronize(); // the main thread will send a notification Executor e = Executor.currentExecutor(); WorkUnit wu = e.getCurrentWorkUnit(); if (wu.isMainWork()) { future.start.set(e.getCurrentExecutable()); } }
/** * All the {@link Executor}s that jointly execute a {@link Task} call this method to synchronize on the end of the task. * * @throws InterruptedException * If any of the member thread is interrupted while waiting for other threads to join, all * the member threads will report {@link InterruptedException}. */ public void synchronizeEnd(Executor e, Queue.Executable executable, Throwable problems, long duration) throws InterruptedException { endLatch.synchronize(); // the main thread will send a notification WorkUnit wu = e.getCurrentWorkUnit(); if (wu.isMainWork()) { if (problems == null) { future.set(executable); e.getOwner().taskCompleted(e, task, duration); } else { future.set(problems); e.getOwner().taskCompletedWithProblems(e, task, duration, problems); } } }
@Override protected void onCriteriaMet() { // on behalf of the member Executors, // the one that executes the main thing will send notifications Executor e = Executor.currentExecutor(); if (e.getCurrentWorkUnit().isMainWork()) { e.getOwner().taskAccepted(e,task); } } };
@Override protected void onCriteriaMet() { // on behalf of the member Executors, // the one that executes the main thing will send notifications // Unclear if this will work with AsynchronousExecution; it *seems* this is only called from synchronize which is only called from synchronizeStart which is only called from an executor thread. Executor e = Executor.currentExecutor(); if (e.getCurrentWorkUnit().isMainWork()) { e.getOwner().taskAccepted(e,task); } } };
@Override protected void onCriteriaMet() { // on behalf of the member Executors, // the one that executes the main thing will send notifications Executor e = Executor.currentExecutor(); if (e.getCurrentWorkUnit().isMainWork()) { e.getOwner().taskAccepted(e, task); } } };
@Override protected void onCriteriaMet() { // on behalf of the member Executors, // the one that executes the main thing will send notifications Executor e = Executor.currentExecutor(); if (e.getCurrentWorkUnit().isMainWork()) { e.getOwner().taskAccepted(e,task); } } };
@Override protected void onCriteriaMet() { // on behalf of the member Executors, // the one that executes the main thing will send notifications Executor e = Executor.currentExecutor(); if (e.getCurrentWorkUnit().isMainWork()) { e.getOwner().taskAccepted(e,task); } } };
/** * All the {@link Executor}s that jointly execute a {@link Task} call this method to synchronize on the start. */ public void synchronizeStart() throws InterruptedException { startLatch.synchronize(); // the main thread will send a notification Executor e = Executor.currentExecutor(); WorkUnit wu = e.getCurrentWorkUnit(); if (wu.isMainWork()) { future.start.set(e.getCurrentExecutable()); } }
if (offer.workUnit.isMainWork()) { pendings.remove(offer.workUnit.context.item);
if (offer.workUnit.isMainWork()) pendings.remove(offer.workUnit.context.item);
if (offer.workUnit.isMainWork()) pendings.remove(offer.workUnit.context.item);
if (offer.workUnit.isMainWork()) pendings.remove(offer.workUnit.context.item);
/** * All the {@link Executor}s that jointly execute a {@link Task} call this method to synchronize on the end of the task. * * @throws InterruptedException * If any of the member thread is interrupted while waiting for other threads to join, all * the member threads will report {@link InterruptedException}. */ public void synchronizeEnd(Executor e, Queue.Executable executable, Throwable problems, long duration) throws InterruptedException { endLatch.synchronize(); // the main thread will send a notification WorkUnit wu = e.getCurrentWorkUnit(); if (wu.isMainWork()) { if (problems == null) { future.set(executable); e.getOwner().taskCompleted(e, task, duration); } else { future.set(problems); e.getOwner().taskCompletedWithProblems(e, task, duration, problems); } } }
/** * All the {@link Executor}s that jointly execute a {@link Task} call this method to synchronize on the end of the task. * * @throws InterruptedException * If any of the member thread is interrupted while waiting for other threads to join, all * the member threads will report {@link InterruptedException}. */ public void synchronizeEnd(Queue.Executable executable, Throwable problems, long duration) throws InterruptedException { endLatch.synchronize(); // the main thread will send a notification Executor e = Executor.currentExecutor(); WorkUnit wu = e.getCurrentWorkUnit(); if (wu.isMainWork()) { if (problems == null) { future.set(executable); e.getOwner().taskCompleted(e, task, duration); } else { future.set(problems); e.getOwner().taskCompletedWithProblems(e, task, duration, problems); } } }
/** * All the {@link Executor}s that jointly execute a {@link Task} call this method to synchronize on the end of the task. * * @throws InterruptedException * If any of the member thread is interrupted while waiting for other threads to join, all * the member threads will report {@link InterruptedException}. */ public void synchronizeEnd(Queue.Executable executable, Throwable problems, long duration) throws InterruptedException { endLatch.synchronize(); // the main thread will send a notification Executor e = Executor.currentExecutor(); WorkUnit wu = e.getCurrentWorkUnit(); if (wu.isMainWork()) { if (problems == null) { future.set(executable); e.getOwner().taskCompleted(e, task, duration); } else { future.set(problems); e.getOwner().taskCompletedWithProblems(e, task, duration, problems); } } }
/** * All the {@link Executor}s that jointly execute a {@link Task} call this method to synchronize on the end of the task. * * @throws InterruptedException * If any of the member thread is interrupted while waiting for other threads to join, all * the member threads will report {@link InterruptedException}. */ public void synchronizeEnd(Queue.Executable executable, Throwable problems, long duration) throws InterruptedException { endLatch.synchronize(); // the main thread will send a notification Executor e = Executor.currentExecutor(); WorkUnit wu = e.getCurrentWorkUnit(); if (wu.isMainWork()) { if (problems == null) { future.set(executable); e.getOwner().taskCompleted(e, task, duration); } else { future.set(problems); e.getOwner().taskCompletedWithProblems(e, task, duration, problems); } } }
/** * All the {@link Executor}s that jointly execute a {@link Task} call this * method to synchronize on the end of the task. * * @throws InterruptedException If any of the member thread is interrupted * while waiting for other threads to join, all the member threads will * report {@link InterruptedException}. */ public void synchronizeEnd(Queue.Executable executable, Throwable problems, long duration) throws InterruptedException { endLatch.synchronize(); // the main thread will send a notification Executor e = Executor.currentExecutor(); WorkUnit wu = e.getCurrentWorkUnit(); if (wu.isMainWork()) { if (problems == null) { future.set(executable); e.getOwner().taskCompleted(e, task, duration); } else { future.set(problems); e.getOwner().taskCompletedWithProblems(e, task, duration, problems); } } }