Kagome
Polkadot Runtime Engine in C++17
spin_lock.cpp
Go to the documentation of this file.
1 
6 #include "common/spin_lock.hpp"
7 
8 namespace kagome::common {
9 
10  void spin_lock::lock() {
11  while (flag_.test_and_set(std::memory_order_acquire)) {
12  }
13  }
14 
16  flag_.clear(std::memory_order_release);
17  }
18 
19 } // namespace kagome::common
std::atomic_flag flag_
Definition: spin_lock.hpp:54