Skip to content

Commit

Permalink
refs #6449 hopefully fixed lock in BC
Browse files Browse the repository at this point in the history
  • Loading branch information
abuts committed Apr 17, 2013
1 parent a83fd58 commit 184cb76
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
7 changes: 3 additions & 4 deletions Code/Mantid/Framework/MDEvents/src/BoxControllerNeXusIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,19 +447,18 @@ void BoxControllerNeXusIO::loadBlock(std::vector<double> & Block, const uint64_t
void BoxControllerNeXusIO::flushData()const
{
Poco::ScopedLock<Poco::FastMutex> _lock(m_fileMutex);
m_File->flush();
m_File->flush();

}
/** flush disk buffer data from memory and close underlying NeXus file*/
void BoxControllerNeXusIO::closeFile()
{
if(m_File)
{
this->flushData();
// lock file
Poco::ScopedLock<Poco::FastMutex> _lock(m_fileMutex);
// write all file-backed data still stack in the data buffer into the file.
this->flushCache();
// lock file
Poco::ScopedLock<Poco::FastMutex> _lock(m_fileMutex);
{
m_File->closeData(); // close events data

Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/MDEvents/src/MDBoxSaveable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace MDEvents
{
}

/** flush data out of the write buffer */
/** flush data out of the file buffer to the HDD */
void MDBoxSaveable::flushData()const
{
m_MDNode->getBoxController()->getFileIO()->flushData();
Expand Down
6 changes: 3 additions & 3 deletions Code/Mantid/Framework/MDEvents/test/MDBoxSaveableTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ static void destroySuite(MDBoxSaveableTest * suite) { delete suite; }
//-----------------------------------------------------------------------------------------
/** Set up the file back end and xest accessing data
* where the number of events in the box is reduced or increased. */
void xest_fileBackEnd_nonConst_EventListChangesSize()
void test_fileBackEnd_nonConst_EventListChangesSize()
{
// Create a box with a controller for the back-end
BoxController_sptr bc(new BoxController(3));
Expand Down Expand Up @@ -718,7 +718,7 @@ static void destroySuite(MDBoxSaveableTest * suite) { delete suite; }
do_deleteNexusFile("MDBoxBinningxest.nxs");
}

void xest_fileBackEnd_binningOperations()
void test_fileBackEnd_binningOperations()
{
do_test_fileBackEnd_binningOperations(false);
}
Expand All @@ -735,7 +735,7 @@ static void destroySuite(MDBoxSaveableTest * suite) { delete suite; }
* for a workspace that is backed by a file (and thus tries to stay below
* a certain amount of memory used).
*/
void xest_splitAllIfNeeded_fileBacked()
void test_splitAllIfNeeded_fileBacked()
{
typedef MDLeanEvent<2> MDE;

Expand Down

0 comments on commit 184cb76

Please sign in to comment.