Banuba SDK
Loading...
Searching...
No Matches
Public Member Functions | List of all members
bnb::spin_lock Class Reference

Public Member Functions

 spin_lock (std::atomic_flag &f)
 

Detailed Description

Definition at line 12 of file concurrency.hpp.

Constructor & Destructor Documentation

◆ spin_lock()

bnb::spin_lock::spin_lock ( std::atomic_flag & f)
inlineexplicit

Definition at line 15 of file concurrency.hpp.

16 : flag(f)
17 {
18 while (flag.test_and_set(std::memory_order_acquire))
19 ;
20 }

◆ ~spin_lock()

bnb::spin_lock::~spin_lock ( )
inline

Definition at line 22 of file concurrency.hpp.

23 {
24 flag.clear(std::memory_order_release);
25 }

The documentation for this class was generated from the following file: