Skip to content

Commit

Permalink
refs #6449 A bit more wandering around (and probably over-locking)
Browse files Browse the repository at this point in the history
  • Loading branch information
abuts committed Apr 17, 2013
1 parent 8347588 commit 4851c70
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/Kernel/src/DiskBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ namespace Kernel
if (m_writeBufferUsed > DISK_BUFFER_SIZE_TO_REPORT_WRITE)
std::cout << "DiskBuffer:: Writing out " << m_writeBufferUsed << " events in " << m_nObjectsToWrite << " objects." << std::endl;

m_mutex.lock();
Poco::ScopedLock<Kernel::Mutex> _lock(m_mutex);
// Holder for any objects that you were NOT able to write.
std::list<ISaveable *> couldNotWrite;
size_t objectsNotWritten(0);
Expand Down Expand Up @@ -218,7 +218,7 @@ namespace Kernel
m_writeBufferUsed = memoryNotWritten;
m_nObjectsToWrite = objectsNotWritten;

m_mutex.unlock();

}


Expand Down
6 changes: 4 additions & 2 deletions Code/Mantid/Framework/MDEvents/src/MDBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -886,15 +886,17 @@ namespace MDEvents
if(!FileSaver->isOpened())
throw(std::invalid_argument(" The data file has to be opened to use box loadAndAddFrom function"));

Poco::ScopedLock<Kernel::Mutex> _lock(m_dataMutex);

std::vector<coord_t> TableData;
FileSaver->loadBlock(TableData,filePosition,nEvents);
this->m_dataMutex.lock();

// convert loaded events to data;
size_t nCurrentEvents = data.size();
this->data.reserve(nCurrentEvents+nEvents);
// convert data to events appending new events to existing
MDE::dataToEvents(TableData,data,false);
this->m_dataMutex.unlock();

}
/** clear file-backed information from the box if such information exists
*
Expand Down

0 comments on commit 4851c70

Please sign in to comment.