/** * 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); } } }
/** * 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(); }
/** * 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(); }
/** * 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(); }
/** * 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(); }
/** * 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); } } }
/** * 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); } } }