public IterationStatistics call(final Mappable<T> mappable, final LambdaVoid<T> body) throws ExecutionException { ProcessGroup<MyProcess> processes = new ProcessGroup<MyProcess>(GaloisRuntime.getRuntime().getMaxThreads()) { @Override protected MyProcess newInstance(int id) { return new MyProcess(id, mappable, body); } }; mappable.beforePmap(this); try { processes.run(); return processes.finish(); } finally { mappable.afterPmap(this); contextObject = null; } }
protected void run() { LambdaVoid<T> wrapped = new LambdaVoid<T>() { @Override public void call(T arg0) { beginIteration(); body.call(arg0); incrementCommitted(); } }; mappable.pmap(wrapped, this); }