/** * Returns {@code true} if the file descriptor is open. */ public boolean isOpen() { return !isClosed(state); }
/** * Returns {@code true} if the file descriptor is open. */ public boolean isOpen() { return !isClosed(state); }
/** * Close the file descriptor. */ public void close() throws IOException { for (;;) { int state = this.state; if (isClosed(state)) { return; } // Once a close operation happens, the channel is considered shutdown. if (casState(state, state | STATE_ALL_MASK)) { break; } } int res = close(fd); if (res < 0) { throw newIOException("close", res); } }
/** * Close the file descriptor. */ public void close() throws IOException { for (;;) { int state = this.state; if (isClosed(state)) { return; } // Once a close operation happens, the channel is considered shutdown. if (casState(state, state | STATE_ALL_MASK)) { break; } } int res = close(fd); if (res < 0) { throw newIOException("close", res); } }
/** * Returns {@code true} if the file descriptor is open. */ public boolean isOpen() { return !isClosed(state); }
/** * Returns {@code true} if the file descriptor is open. */ public boolean isOpen() { return !isClosed(state); }
/** * Returns {@code true} if the file descriptor is open. */ public boolean isOpen() { return !isClosed(state); }
/** * Returns {@code true} if the file descriptor is open. */ public boolean isOpen() { return !isClosed(state); }
/** * Close the file descriptor. */ public void close() throws IOException { for (;;) { int state = this.state; if (isClosed(state)) { return; } // Once a close operation happens, the channel is considered shutdown. if (casState(state, state | STATE_ALL_MASK)) { break; } } int res = close(fd); if (res < 0) { throw newIOException("close", res); } }
/** * Close the file descriptor. */ public void close() throws IOException { for (;;) { int state = this.state; if (isClosed(state)) { return; } // Once a close operation happens, the channel is considered shutdown. if (casState(state, state | STATE_ALL_MASK)) { break; } } int res = close(fd); if (res < 0) { throw newIOException("close", res); } }
/** * Close the file descriptor. */ public void close() throws IOException { for (;;) { int state = this.state; if (isClosed(state)) { return; } // Once a close operation happens, the channel is considered shutdown. if (casState(state, state | STATE_ALL_MASK)) { break; } } int res = close(fd); if (res < 0) { throw newIOException("close", res); } }
/** * Close the file descriptor. */ public void close() throws IOException { for (;;) { int state = this.state; if (isClosed(state)) { return; } // Once a close operation happens, the channel is considered shutdown. if (casState(state, state | STATE_ALL_MASK)) { break; } } int res = close(fd); if (res < 0) { throw newIOException("close", res); } }