public Blocker acquire() throws IOException { _lock.lock(); long idle = getIdleTimeout(); try { while (_blocker._state != IDLE) { if (idle > 0 && (idle < Long.MAX_VALUE / 2)) { // Wait a little bit longer than the blocker might block if (!_idle.await(idle * 2, TimeUnit.MILLISECONDS)) throw new IOException(new TimeoutException()); } else _idle.await(); } _blocker._state = null; } catch (final InterruptedException e) { throw new InterruptedIOException(); } finally { _lock.unlock(); } return _blocker; }
public Blocker acquire() throws IOException { _lock.lock(); long idle = getIdleTimeout(); try { while (_blocker._state != IDLE) { if (idle > 0 && (idle < Long.MAX_VALUE / 2)) { // Wait a little bit longer than the blocker might block if (!_idle.await(idle * 2, TimeUnit.MILLISECONDS)) throw new IOException(new TimeoutException()); } else _idle.await(); } _blocker._state = null; } catch (final InterruptedException e) { throw new InterruptedIOException(); } finally { _lock.unlock(); } return _blocker; }
public Blocker acquire() throws IOException { _lock.lock(); long idle = getIdleTimeout(); try { while (_blocker._state != IDLE) { if (idle > 0 && (idle < Long.MAX_VALUE / 2)) { // Wait a little bit longer than the blocker might block if (!_idle.await(idle * 2, TimeUnit.MILLISECONDS)) throw new IOException(new TimeoutException()); } else _idle.await(); } _blocker._state = null; } catch (final InterruptedException e) { throw new InterruptedIOException(); } finally { _lock.unlock(); } return _blocker; }
long idle = getIdleTimeout(); try { while (_state == null) {
long idle = getIdleTimeout(); try { while (_state == null) {
long idle = getIdleTimeout(); try { while (_state == null) {