Raven Core
3.0.0
P2P Digital Currency
src
reverselock.h
Go to the documentation of this file.
1
// Copyright (c) 2015-2016 The Bitcoin Core developers
2
// Copyright (c) 2017-2019 The Raven Core developers
3
// Distributed under the MIT software license, see the accompanying
4
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
5
6
#ifndef RAVEN_REVERSELOCK_H
7
#define RAVEN_REVERSELOCK_H
8
12
template
<
typename
Lock>
13
class
reverse_lock
14
{
15
public
:
16
17
explicit
reverse_lock
(Lock& _lock) :
lock
(_lock) {
18
_lock.unlock();
19
_lock.swap(
templock
);
20
}
21
22
~reverse_lock
() {
23
templock
.lock();
24
templock
.swap(
lock
);
25
}
26
27
private
:
28
reverse_lock
(
reverse_lock
const
&);
29
reverse_lock
&
operator=
(
reverse_lock
const
&);
30
31
Lock&
lock
;
32
Lock
templock
;
33
};
34
35
#endif // RAVEN_REVERSELOCK_H
reverse_lock::operator=
reverse_lock & operator=(reverse_lock const &)
reverse_lock::lock
Lock & lock
Definition:
reverselock.h:31
reverse_lock::templock
Lock templock
Definition:
reverselock.h:32
reverse_lock::reverse_lock
reverse_lock(Lock &_lock)
Definition:
reverselock.h:17
reverse_lock
An RAII-style reverse lock.
Definition:
reverselock.h:13
reverse_lock::~reverse_lock
~reverse_lock()
Definition:
reverselock.h:22
Generated on Mon Jul 29 2019 02:32:20 for Raven Core by
1.8.13