Mantid
Loading...
Searching...
No Matches
Framework
Kernel
src
ReadLock.cpp
Go to the documentation of this file.
1
// Mantid Repository : https://github.com/mantidproject/mantid
2
//
3
// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4
// NScD Oak Ridge National Laboratory, European Spallation Source,
5
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6
// SPDX - License - Identifier: GPL - 3.0 +
7
#include "
MantidKernel/ReadLock.h
"
8
#include "
MantidKernel/DataItem.h
"
9
10
#include <Poco/RWLock.h>
11
12
namespace
Mantid::Kernel
{
13
14
//----------------------------------------------------------------------------------------------
17
ReadLock::ReadLock
(
const
DataItem
&item) : m_item(item) {
18
// Acquire a read lock.
19
m_item
.
m_lock
->readLock();
20
}
21
22
//----------------------------------------------------------------------------------------------
25
ReadLock::~ReadLock
() {
26
// Unlock
27
m_item
.
m_lock
->unlock();
28
}
29
30
}
// namespace Mantid::Kernel
DataItem.h
ReadLock.h
Mantid::Kernel::DataItem
This class forms the base class of any item that wishes to be stored in the analysis data service.
Definition:
DataItem.h:39
Mantid::Kernel::DataItem::m_lock
std::unique_ptr< Poco::RWLock > m_lock
Multiple-reader/single-writer lock to restrict multithreaded access to the data item.
Definition:
DataItem.h:68
Mantid::Kernel::ReadLock::~ReadLock
virtual ~ReadLock()
Destructor.
Definition:
ReadLock.cpp:25
Mantid::Kernel::ReadLock::ReadLock
ReadLock(const DataItem &item)
Constructor.
Definition:
ReadLock.cpp:17
Mantid::Kernel::ReadLock::m_item
const DataItem & m_item
Reference to the data item we are locking.
Definition:
ReadLock.h:51
Mantid::Kernel
Definition:
AnnularRingAbsorption.h:15
Generated on Tue Jan 3 2023 11:57:51 for Mantid by
1.9.5