@Override public void run() { c.startFlyWeightTask(new WorkUnitContext(p).createWorkUnit(p.task)); makePending(p); } };
private void finish1(@CheckForNull Throwable problems) { if (problems != null) { // for some reason the executor died. this is really // a bug in the code, but we don't want the executor to die, // so just leave some info and go on to build other things LOGGER.log(Level.SEVERE, "Executor threw an exception", problems); workUnit.context.abort(problems); } long time = System.currentTimeMillis() - startTime; LOGGER.log(FINE, "{0} completed {1} in {2}ms", new Object[]{getName(), executable, time}); try { workUnit.context.synchronizeEnd(this, executable, problems, time); } catch (InterruptedException e) { workUnit.context.abort(e); } finally { workUnit.setExecutor(null); } }
WorkUnitContext wuc = new WorkUnitContext(p); LOGGER.log(Level.FINEST, "Found a matching executor for {0}. Using it.", taskDisplayName); m.execute(wuc); if (!wuc.getWorkUnits().isEmpty()) { LOGGER.log(Level.FINEST, "BuildableItem {0} marked as pending.", taskDisplayName); makePending(p);
final String threadName = getName(); try { workUnit.context.synchronizeStart(); workUnit.context.abort(e); problems = e; } finally { finishTime = System.currentTimeMillis(); try { workUnit.context.synchronizeEnd(executable,problems,finishTime - startTime); } catch (InterruptedException e) { workUnit.context.abort(e); continue; } finally {
WorkUnitContext wuc = new WorkUnitContext(p); m.execute(wuc); if (!wuc.getWorkUnits().isEmpty()) pendings.add(p); if (offer != null && offer.workUnit != null) { offer.workUnit.context.abort(new AbortException());
private void execute(WorkChunk wc, WorkUnitContext wuc) { assert capacity() >= wc.size(); int e = 0; for (SubTask s : wc) { while (!get(e).isAvailable()) e++; get(e++).set(wuc.createWorkUnit(s)); } } }
private Runnable createFlyWeightTaskRunnable(final BuildableItem p, final Computer c) { if (LOGGER.isLoggable(Level.FINEST)) { LOGGER.log(Level.FINEST, "Creating flyweight task {0} for computer {1}", new Object[]{p.task.getFullDisplayName(), c.getName()}); } return new Runnable() { @Override public void run() { c.startFlyWeightTask(new WorkUnitContext(p).createWorkUnit(p.task)); makePending(p); } }; }
@Deprecated public void synchronizeEnd(Queue.Executable executable, Throwable problems, long duration) throws InterruptedException { synchronizeEnd(Executor.currentExecutor(), executable, problems, duration); }
workUnit.context.synchronizeStart();
if (offer != null && offer.workUnit != null) { offer.workUnit.context.abort(new AbortException());
/** * If this is representing an item that started executing, this property returns * the primary executable (such as {@link AbstractBuild}) that created out of it. */ @Exported public @CheckForNull Executable getExecutable() { return outcome!=null ? outcome.getPrimaryWorkUnit().getExecutable() : null; }
final String threadName = getName(); try { workUnit.context.synchronizeStart(); workUnit.context.abort(e); problems = e; } finally { finishTime = System.currentTimeMillis(); try { workUnit.context.synchronizeEnd(executable,problems,finishTime - startTime); } catch (InterruptedException e) { workUnit.context.abort(e); continue; } finally {
WorkUnitContext wuc = new WorkUnitContext(p); m.execute(wuc); if (!wuc.getWorkUnits().isEmpty()) pendings.add(p); if (offer != null && offer.workUnit != null) { offer.workUnit.context.abort(new AbortException());
private void execute(WorkChunk wc, WorkUnitContext wuc) { assert capacity() >= wc.size(); int e = 0; for (SubTask s : wc) { while (!get(e).isAvailable()) e++; get(e++).set(wuc.createWorkUnit(s)); } } }
return new Runnable() { @Override public void run() { c.startFlyWeightTask(new WorkUnitContext(p).createWorkUnit(p.task)); makePending(p);
@Deprecated public void synchronizeEnd(Queue.Executable executable, Throwable problems, long duration) throws InterruptedException { synchronizeEnd(Executor.currentExecutor(), executable, problems, duration); }
workUnit.context.synchronizeStart();
/** * If this is representing an item that started executing, this property returns * the primary executable (such as {@link AbstractBuild}) that created out of it. */ @Exported public @CheckForNull Executable getExecutable() { return outcome!=null ? outcome.getPrimaryWorkUnit().getExecutable() : null; }
final String threadName = getName(); try { workUnit.context.synchronizeStart(); workUnit.context.abort(e); problems = e; } finally { finishTime = System.currentTimeMillis(); try { workUnit.context.synchronizeEnd(executable, problems, finishTime - startTime); } catch (InterruptedException e) { workUnit.context.abort(e); continue; } finally {
WorkUnitContext wuc = new WorkUnitContext(p); m.execute(wuc); if (!wuc.getWorkUnits().isEmpty()) pendings.add(p); if (offer != null && offer.workUnit != null) { offer.workUnit.context.abort(new AbortException());