mirror of
https://github.com/OPM/ResInsight.git
synced 2026-11-03 04:40:49 -06:00
Use mutex when import well paths
A shared data structure (RifWellPathImporter) is used when importing well paths. Add mutex to ensure single use of shared data structure.
This commit is contained in:
1 parent
83443ae2ff
commit
1b509c0384
2 files changed
+4
-1
No files matched your search
@@ -45,7 +45,8 @@ void RimFileWellPathDataLoader::loadData( caf::PdmObject& pdmObject, const QStri
|
|||||||
auto* fWPath = dynamic_cast<RimFileWellPath*>( &pdmObject );
|
auto* fWPath = dynamic_cast<RimFileWellPath*>( &pdmObject );
|
||||||
if ( fWPath && !fWPath->filePath().isEmpty() )
|
if ( fWPath && !fWPath->filePath().isEmpty() )
|
||||||
{
|
{
|
||||||
QString errorMessage;
|
QMutexLocker lock( &m_mutex );
|
||||||
|
QString errorMessage;
|
||||||
if ( !fWPath->readWellPathFile( &errorMessage, m_wellPathImporter.get(), false ) )
|
if ( !fWPath->readWellPathFile( &errorMessage, m_wellPathImporter.get(), false ) )
|
||||||
{
|
{
|
||||||
RiaLogging::warning( errorMessage );
|
RiaLogging::warning( errorMessage );
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
#include "cafDataLoader.h"
|
#include "cafDataLoader.h"
|
||||||
#include "cafProgressInfo.h"
|
#include "cafProgressInfo.h"
|
||||||
|
|
||||||
|
#include <QMutex>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@@ -42,4 +43,5 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<RifWellPathImporter> m_wellPathImporter;
|
std::unique_ptr<RifWellPathImporter> m_wellPathImporter;
|
||||||
|
QMutex m_mutex;
|
||||||
};
|
};
|
||||||
Reference in new issue
Block a user