SObjectizer  5.5
Public Member Functions | Private Attributes | List of all members
so_5::spinlock_t< Backoff > Class Template Reference

A simple spinlock (analog of std::mutex). More...

#include <spinlocks.hpp>

Public Member Functions

 spinlock_t ()
 
 spinlock_t (const spinlock_t &)=delete
 
 spinlock_t (spinlock_t &&)=delete
 
spinlock_toperator= (const spinlock_t &)=delete
 
spinlock_toperator= (spinlock_t &&)=delete
 
void lock ()
 Lock object. More...
 
void unlock ()
 Unlock object. More...
 

Private Attributes

std::atomic_bool m_flag
 Atomic flag which is used as actual lock. More...
 

Detailed Description

template<class Backoff>
class so_5::spinlock_t< Backoff >

A simple spinlock (analog of std::mutex).

Since
v.5.4.0
Note
Since v.5.5.22.2 a TATAS spinlock implementation is used. Implementation is provided by Pavel Begunkov.

Constructor & Destructor Documentation

◆ spinlock_t() [1/3]

template<class Backoff>
so_5::spinlock_t< Backoff >::spinlock_t ( )
inline

◆ spinlock_t() [2/3]

template<class Backoff>
so_5::spinlock_t< Backoff >::spinlock_t ( const spinlock_t< Backoff > &  )
delete

◆ spinlock_t() [3/3]

template<class Backoff>
so_5::spinlock_t< Backoff >::spinlock_t ( spinlock_t< Backoff > &&  )
delete

Member Function Documentation

◆ lock()

template<class Backoff>
void so_5::spinlock_t< Backoff >::lock ( )
inline

Lock object.

◆ operator=() [1/2]

template<class Backoff>
spinlock_t& so_5::spinlock_t< Backoff >::operator= ( const spinlock_t< Backoff > &  )
delete

◆ operator=() [2/2]

template<class Backoff>
spinlock_t& so_5::spinlock_t< Backoff >::operator= ( spinlock_t< Backoff > &&  )
delete

◆ unlock()

template<class Backoff>
void so_5::spinlock_t< Backoff >::unlock ( )
inline

Unlock object.

Member Data Documentation

◆ m_flag

template<class Backoff>
std::atomic_bool so_5::spinlock_t< Backoff >::m_flag
private

Atomic flag which is used as actual lock.


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