/** * Closes an open channel. If the channel is already closed then this method * has no effect, otherwise it closes the receiver via the * {@code implCloseChannel} method. * <p> * If an attempt is made to perform an operation on a closed channel then a * {@link java.nio.channels.ClosedChannelException} is thrown. * <p> * If multiple threads attempt to simultaneously close a channel, then only * one thread will run the closure code and the others will be blocked until * the first one completes. * * @throws IOException * if a problem occurs while closing this channel. * @see java.nio.channels.Channel#close() */ @Override public final void close() throws IOException { if (!closed) { synchronized (this) { if (!closed) { closed = true; implCloseChannel(); } } } }
/** * Closes an open channel. If the channel is already closed then this method * has no effect, otherwise it closes the receiver via the * {@code implCloseChannel} method. * <p> * If an attempt is made to perform an operation on a closed channel then a * {@link java.nio.channels.ClosedChannelException} is thrown. * <p> * If multiple threads attempt to simultaneously close a channel, then only * one thread will run the closure code and the others will be blocked until * the first one completes. * * @throws IOException * if a problem occurs while closing this channel. * @see java.nio.channels.Channel#close() */ @Override public final void close() throws IOException { if (!closed) { synchronized (this) { if (!closed) { closed = true; implCloseChannel(); } } } }
/** * Closes an open channel. If the channel is already closed then this method * has no effect, otherwise it closes the receiver via the * {@code implCloseChannel} method. * <p> * If an attempt is made to perform an operation on a closed channel then a * {@link java.nio.channels.ClosedChannelException} is thrown. * <p> * If multiple threads attempt to simultaneously close a channel, then only * one thread will run the closure code and the others will be blocked until * the first one completes. * * @throws IOException * if a problem occurs while closing this channel. * @see java.nio.channels.Channel#close() */ @Override public final void close() throws IOException { if (!closed) { synchronized (this) { if (!closed) { closed = true; implCloseChannel(); } } } }
/** * Closes an open channel. If the channel is already closed then this method * has no effect, otherwise it closes the receiver via the * {@code implCloseChannel} method. * <p> * If an attempt is made to perform an operation on a closed channel then a * {@link java.nio.channels.ClosedChannelException} is thrown. * <p> * If multiple threads attempt to simultaneously close a channel, then only * one thread will run the closure code and the others will be blocked until * the first one completes. * * @throws IOException * if a problem occurs while closing this channel. * @see java.nio.channels.Channel#close() */ @Override public final void close() throws IOException { if (!closed) { synchronized (this) { if (!closed) { closed = true; implCloseChannel(); } } } }
/** * Closes an open channel. If the channel is already closed then this method * has no effect, otherwise it closes the receiver via the * {@code implCloseChannel} method. * <p> * If an attempt is made to perform an operation on a closed channel then a * {@link java.nio.channels.ClosedChannelException} is thrown. * <p> * If multiple threads attempt to simultaneously close a channel, then only * one thread will run the closure code and the others will be blocked until * the first one completes. * * @throws IOException * if a problem occurs while closing this channel. * @see java.nio.channels.Channel#close() */ @Override public final void close() throws IOException { if (!closed) { synchronized (this) { if (!closed) { closed = true; implCloseChannel(); } } } }
/** * Closes an open channel. If the channel is already closed then this method * has no effect, otherwise it closes the receiver via the * {@code implCloseChannel} method. * <p> * If an attempt is made to perform an operation on a closed channel then a * {@link java.nio.channels.ClosedChannelException} is thrown. * <p> * If multiple threads attempt to simultaneously close a channel, then only * one thread will run the closure code and the others will be blocked until * the first one completes. * * @throws IOException * if a problem occurs while closing this channel. * @see java.nio.channels.Channel#close() */ @Override public final void close() throws IOException { if (!closed) { synchronized (this) { if (!closed) { closed = true; implCloseChannel(); } } } }
/** * Closes an open channel. If the channel is already closed then this method * has no effect, otherwise it closes the receiver via the * {@code implCloseChannel} method. * <p> * If an attempt is made to perform an operation on a closed channel then a * {@link java.nio.channels.ClosedChannelException} is thrown. * <p> * If multiple threads attempt to simultaneously close a channel, then only * one thread will run the closure code and the others will be blocked until * the first one completes. * * @throws IOException * if a problem occurs while closing this channel. * @see java.nio.channels.Channel#close() */ @Override public final void close() throws IOException { if (!closed) { synchronized (this) { if (!closed) { closed = true; implCloseChannel(); } } } }