Do not synchronize on isClosed()
There is a deadlock while reading the state variable if close() is running. This switches the state to be volatile instead - it's only written to inside the lengthy close() lock, so this should be reasonable.
Showing
Please register or sign in to comment