> -----Original Message----- > From: Veit Jahns [mailto:nuncupa...@googlemail.com] > Sent: Wednesday, August 11, 2010 10:52 PM > To: clucene-developers@lists.sourceforge.net > Subject: Re: [CLucene-dev] RAMDirectory testing (using MockRAMDirectory) > > > > I agree, it is better to do this in deleteFile than in RAMFile destructor. > > The only thing I'm not sure about is the mutex used for sync - files_mutex > > is used in deleteFile. > > Shouldn't it be RAMDirectory's THIS_LOCK? > > Maybe. But every other method manipulating the files map is using the > files_mutex also.
You are right. Anyway, I'm still not sure about synchonization of sizeInBytes adding and substracting, as add is synchronized in RAMFile by directory->THIS_LOCK and substracting in RAMDirectory::doDeleteFile by files_mutex. I added sync for sure (see diff), but perhaps this isn't really needed... Borek
RAMDirectory.cpp.diff
Description: RAMDirectory.cpp.diff
------------------------------------------------------------------------------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev
_______________________________________________ CLucene-developers mailing list CLucene-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/clucene-developers