Should java/nio/channels/spi/ be synchronized ?

Sean Chou zhouyx at
Tue Dec 4 02:53:04 PST 2012


I found AbstractInterruptibleChannel.close() is synchronized
using closeLock, but isOpen() is not synchronized. Javadoc of isOpen() says
"Returns: true if, and only if, this channel is open". I want to know
if isOpen() method is designed not to synchronize with closeLock ? Because
in close() method the closeLock embraces "open = false;" and
" implCloseChannel(); " , which looks like the open variable should always
reflect the real state.

Best Regards,
Sean Chou
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the nio-dev mailing list