/** * Submitting a new input for processing. Submitted input jobs are first * buffered, and then concurrently processed by workers. If the buffer is * full, the method blocks until new space is available. * * @param input * the input to be processed * @return {@code true} if the input has been successfully submitted for * computation; the input cannot be submitted, e.g., if * {@link #finish()} has been called * @throws InterruptedException * thrown if interrupted during waiting for space to be * available */ public synchronized boolean submit(I input) throws InterruptedException { if (termination || isInterrupted()) return false; buffer_.put(input); return true; }
/** * Submitting a new input for processing. Submitted input jobs are first * buffered, and then concurrently processed by workers. If the buffer is * full, the method blocks until new space is available. * * @param input * the input to be processed * @return {@code true} if the input has been successfully submitted for * computation; the input cannot be submitted, e.g., if * {@link #finish()} has been called * @throws InterruptedException * thrown if interrupted during waiting for space to be * available */ public synchronized boolean submit(I input) throws InterruptedException { if (termination || isInterrupted()) return false; buffer_.put(input); return true; }
/** * Submitting a new input for processing. Submitted input jobs are first * buffered, and then concurrently processed by workers. If the buffer is * full, the method blocks until new space is available. * * @param input * the input to be processed * @return {@code true} if the input has been successfully submitted for * computation; the input cannot be submitted, e.g., if * {@link #finish()} has been called * @throws InterruptedException * thrown if interrupted during waiting for space to be * available */ public synchronized boolean submit(I input) throws InterruptedException { if (termination || isInterrupted()) return false; buffer_.put(input); return true; }
break; if (!computation_.isInterrupted()) fail(); computation_.finish(); if (!computation_.isInterrupted()) { break;