Mantid
Loading...
Searching...
No Matches
Framework
Kernel
src
WriteLock.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/WriteLock.h
"
8
#include "
MantidKernel/DataItem.h
"
9
#include <Poco/RWLock.h>
10
11
namespace
Mantid::Kernel
{
12
13
//----------------------------------------------------------------------------------------------
16
WriteLock::WriteLock
(
const
DataItem
&item) : m_item(item) {
17
// Acquire a write lock.
18
m_item
.
m_lock
->writeLock();
19
}
20
21
//----------------------------------------------------------------------------------------------
24
WriteLock::~WriteLock
() {
25
// Unlock
26
m_item
.
m_lock
->unlock();
27
}
28
29
}
// namespace Mantid::Kernel
DataItem.h
WriteLock.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::WriteLock::WriteLock
WriteLock(const DataItem &item)
Constructor.
Definition:
WriteLock.cpp:16
Mantid::Kernel::WriteLock::m_item
const DataItem & m_item
Reference to the data item we are locking.
Definition:
WriteLock.h:55
Mantid::Kernel::WriteLock::~WriteLock
virtual ~WriteLock()
Destructor.
Definition:
WriteLock.cpp:24
Mantid::Kernel
Definition:
AnnularRingAbsorption.h:15
Generated on Tue Jan 3 2023 11:57:52 for Mantid by
1.9.5