SpinLock.hpp

This File On Github
Ask A Question

API: latest
module: oatpp
#include "oatpp/core/concurrency/SpinLock.hpp"

SpinLock

SpinLock implementation based on atomic.

namespace oatpp { namespace concurrency { 
  class SpinLock {}
}}

Typedefs

Type Name Summary
std::atomic<bool> Atom Convenience typedef for atomic bool.

Methods

Return Type Name Summary
[none] SpinLock Constructor. Lock on construction.
[none] ~SpinLock Non virtual destructor. Unlock on destruction.
void lock Spin-Lock using atomic boolean.
void unlock Spin-Unlock using atomic boolean.

SpinLock::Atom

Convenience typedef for atomic bool.

typedef std::atomic<bool> Atom

SpinLock::SpinLock

Constructor. Lock on construction.

  • @param atom - atomic boolean.

SpinLock(Atom& atom)

SpinLock::~SpinLock

Non virtual destructor. Unlock on destruction.

~SpinLock()

SpinLock::lock

Spin-Lock using atomic boolean.

  • @param atom - atomic boolean.

static void lock(Atom& atom)

SpinLock::unlock

Spin-Unlock using atomic boolean.

  • @param atom - atomic boolean.

static void unlock(Atom& atom)