Typically, I would expect a call to a CloseAble's close() to release the resources before returning; here it is not the case due to threading.
More importantly, a CloseAble's close() is supposed to be idempotent; I fear this will not be the case here, due to the eventual call to notifyAll()
On the other hand, your contribution forced me to have another look at this class and I realized that the close variable needs to be made volatile so that would be a welcome change :)
Hi. I have a concern with this:
On the other hand, your contribution forced me to have another look at this class and I realized that the close variable needs to be made volatile so that would be a welcome change :)