Pothos  0.3.3-g32d3017c
The Pothos dataflow programming software suite
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
Public Member Functions | List of all members
Pothos::Util::SpinLock Class Reference

#include <SpinLock.hpp>

Public Member Functions

 SpinLock (void)
 Create a new unlocked spin lock. More...
 
void lock (void)
 Lock the spin lock, block if already locked. More...
 
void unlock (void)
 Unlock the spin lock (should be already locked) More...
 

Detailed Description

A generic spin lock implementation using std::atomic.

There are no embedded back-off or sleep conditions in this lock, therefore only use this lock to protect very brief code sections.

This lock can be used with std::lock_guard<Pothos::Util::SpinLock>

Constructor & Destructor Documentation

Pothos::Util::SpinLock::SpinLock ( void  )
inline

Create a new unlocked spin lock.

Member Function Documentation

void Pothos::Util::SpinLock::lock ( void  )
inline

Lock the spin lock, block if already locked.

void Pothos::Util::SpinLock::unlock ( void  )
inline

Unlock the spin lock (should be already locked)


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