/** * Internal get routine. * * @param ignoreInterrupts Whether to ignore interrupts. * @return Result. * @throws IgniteCheckedException If failed. */ private R get0(boolean ignoreInterrupts) throws IgniteCheckedException { if (isDone() || !registerWaiter(Thread.currentThread())) return resolve(); boolean interrupted = false; try { while (true) { LockSupport.park(); if (Thread.interrupted()) { interrupted = true; if (!ignoreInterrupts) { unregisterWaiter(); throw new IgniteInterruptedCheckedException("Got interrupted while waiting for future to complete."); } } if (isDone()) return resolve(); } } finally { if (interrupted) Thread.currentThread().interrupt(); } }
/** * Internal get routine. * * @param ignoreInterrupts Whether to ignore interrupts. * @return Result. * @throws IgniteCheckedException If failed. */ private R get0(boolean ignoreInterrupts) throws IgniteCheckedException { if (isDone() || !registerWaiter(Thread.currentThread())) return resolve(); boolean interrupted = false; try { while (true) { LockSupport.park(); if (Thread.interrupted()) { interrupted = true; if (!ignoreInterrupts) { unregisterWaiter(); throw new IgniteInterruptedCheckedException("Got interrupted while waiting for future to complete."); } } if (isDone()) return resolve(); } } finally { if (interrupted) Thread.currentThread().interrupt(); } }