Kagome
Polkadot Runtime Engine in C++17
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
spin_lock.hpp
Go to the documentation of this file.
1
6
#ifndef KAGOME_SPIN_LOCK_HPP
7
#define KAGOME_SPIN_LOCK_HPP
8
9
#include <atomic>
10
11
namespace
kagome::common
{
12
32
class
spin_lock
{
// the name styling is unified with std
33
public
:
34
spin_lock
() =
default
;
35
spin_lock
(
const
spin_lock
&) =
delete
;
36
spin_lock
(
spin_lock
&&) =
delete
;
37
spin_lock
&
operator=
(
const
spin_lock
&) =
delete
;
38
spin_lock
&
operator=
(
spin_lock
&&) =
delete
;
39
46
void
lock
();
47
51
void
unlock
();
52
53
private
:
54
std::atomic_flag
flag_
= ATOMIC_FLAG_INIT;
55
};
56
57
}
// namespace kagome::common
58
59
#endif // KAGOME_SPIN_LOCK_HPP
kagome::common::spin_lock::flag_
std::atomic_flag flag_
Definition:
spin_lock.hpp:54
kagome::common::spin_lock::lock
void lock()
Definition:
spin_lock.cpp:10
kagome::common::spin_lock
Definition:
spin_lock.hpp:32
kagome::common::spin_lock::spin_lock
spin_lock()=default
kagome::common
Definition:
blob.cpp:19
kagome::common::spin_lock::unlock
void unlock()
Definition:
spin_lock.cpp:15
kagome::common::spin_lock::operator=
spin_lock & operator=(const spin_lock &)=delete
core
common
spin_lock.hpp
Generated by
1.8.11