locking in zipfs demo
Alan.Bateman at Sun.COM
Thu Dec 3 00:51:00 PST 2009
Joel Uckelman wrote:
> 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?
It looks like it was intended to support asynchronous close of the zip
file system, in which case it should be using fs.begin() and fs.end()
rather than its own lock (Rajendra - can you confirm this?).
More information about the nio-dev