alternative Standard Libary  0.29.8
std::atomic_spinlock Klassenreferenz

#include <spinlock.hpp>

+ Klassendiagramm für std::atomic_spinlock:
+ Zusammengehörigkeiten von std::atomic_spinlock:

Öffentliche Typen

enum  type { Locked, Unlocked }
 
using lock_type = atomic_spinlock::type
 
using native_handle_type = atomic_spinlock
 

Öffentliche Methoden

 atomic_spinlock ()
 
 ~atomic_spinlock ()
 
void lock (void)
 abstract function lock the current context Mehr ...
 
bool try_lock (void)
 abstract function try to lock the current context Mehr ...
 
void unlock (void)
 abstract function unlock the current locked context Mehr ...
 
native_handle_typenative_handle ()
 
 atomic_spinlock (const atomic_spinlock &)=delete
 
atomic_spinlockoperator= (const atomic_spinlock &)=delete
 

Ausführliche Beschreibung

Dokumentation der benutzerdefinierten Datentypen

◆ lock_type

◆ native_handle_type

Dokumentation der Aufzählungstypen

◆ type

Aufzählungswerte
Locked 
Unlocked 
66 {Locked, Unlocked };
Definition: spinlock.hpp:66
Definition: spinlock.hpp:66

Beschreibung der Konstruktoren und Destruktoren

◆ atomic_spinlock() [1/2]

std::atomic_spinlock::atomic_spinlock ( )
inline
70  : m_locked() {
71 
72  }

◆ ~atomic_spinlock()

std::atomic_spinlock::~atomic_spinlock ( )
inline
73  {
74 
75  }

◆ atomic_spinlock() [2/2]

std::atomic_spinlock::atomic_spinlock ( const atomic_spinlock )
delete

Dokumentation der Elementfunktionen

◆ lock()

void std::atomic_spinlock::lock ( void  )
inlinevirtual

abstract function lock the current context

Implementiert std::lock_base.

77  {
78  while( m_locked.exchange(Locked, MemoryOrder::Acquire) == Locked) {
79 
80  }
81  }
value_type exchange(value_type v, MemoryOrder::MemoryOrder_t order=MemoryOrder::SeqCst)
Definition: atomic.hpp:70
Definition: spinlock.hpp:66
Definition: atomic.hpp:45

◆ native_handle()

native_handle_type& std::atomic_spinlock::native_handle ( )
inline
93  {
94  return *this;
95  }

◆ operator=()

atomic_spinlock& std::atomic_spinlock::operator= ( const atomic_spinlock )
delete

◆ try_lock()

bool std::atomic_spinlock::try_lock ( void  )
inlinevirtual

abstract function try to lock the current context

Implementiert std::lock_base.

82  {
83  if( m_locked.exchange(Locked, MemoryOrder::Acquire) == Locked)
84  return false;
85  else
86  lock();
87  return true;
88  }
value_type exchange(value_type v, MemoryOrder::MemoryOrder_t order=MemoryOrder::SeqCst)
Definition: atomic.hpp:70
void lock(void)
abstract function lock the current context
Definition: spinlock.hpp:77
Definition: spinlock.hpp:66
Definition: atomic.hpp:45

◆ unlock()

void std::atomic_spinlock::unlock ( void  )
inlinevirtual

abstract function unlock the current locked context

Implementiert std::lock_base.

89  {
91  }
Definition: spinlock.hpp:66
Definition: atomic.hpp:46
void store(value_type v, MemoryOrder::MemoryOrder_t order=MemoryOrder::SeqCst)
Definition: atomic.hpp:65

Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Datei: