Skip to content

Commit

Permalink
Re #5462. Read-lock workspace for thread-safety.
Browse files Browse the repository at this point in the history
I've seen crashes at this point when running live data and the workspace updates.
We need to keep an eye on performance here - this locks the workspace for every single
data point (bin). If we see problems, we may have to refactor to do it more 'globally'.
  • Loading branch information
RussellTaylor committed Jun 18, 2012
1 parent a5de66e commit ec967d6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Code/Mantid/MantidPlot/src/Mantid/MantidMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "../pixmaps.h"

#include "MantidAPI/TextAxis.h"
#include "MantidKernel/ReadLock.h"

#include <QtGlobal>
#include <QTextStream>
Expand Down Expand Up @@ -1456,6 +1457,8 @@ void MantidMatrixModel::setup(const Mantid::API::MatrixWorkspace* ws,

double MantidMatrixModel::data(int row, int col) const
{
Mantid::Kernel::ReadLock _lock(*m_workspace);

double val;
if (m_type == X)
{
Expand Down

0 comments on commit ec967d6

Please sign in to comment.