locking in zipfs demo

Joel Uckelman uckelman at nomic.net
Wed Dec 2 15:27:59 PST 2009

I'm puzzled by the ReentrantReadWriteLock used in ZipFilePath in various
place. It seems to be locking calls to getResolvedPathForZip(), which
sets the pathToZip member if it's null. Is there a reason for using a
lock for this instead of making pathToZip volatile like the offsets
ArrayList is?


More information about the nio-dev mailing list