public final void doWhileLocked() throws IOException { Lock lock = this.lockRegistry.obtain(this.key); try { lock.lockInterruptibly(); try { this.whileLocked(); } finally { lock.unlock(); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new MessagingException("Thread was interrupted while performing task", e); } }
public final void doWhileLocked() throws IOException { Lock lock = this.lockRegistry.obtain(this.key); try { lock.lockInterruptibly(); try { this.whileLocked(); } finally { lock.unlock(); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new MessagingException("Thread was interrupted while performing task", e); } }