Pothos  0.7.0-gf7fbae99
The Pothos dataflow programming software suite
Public Types | Public Member Functions | List of all members
Pothos::Util::SpinLockRW Class Reference

#include <SpinLockRW.hpp>

Public Types

typedef Pothos::Util::SharedLock< SpinLockRWSharedLock
 Convenient typedef for shared lock type. More...
 

Public Member Functions

 SpinLockRW (void)
 Create a new unlocked spin lock. More...
 
bool try_lock_shared (void) noexcept
 Try to lock shared, return true for lock. More...
 
void lock_shared (void) noexcept
 Lock for multiple reader access. More...
 
void unlock_shared (void) noexcept
 Unlock from multiple reader access. More...
 
bool try_lock (void) noexcept
 Try to lock, return true for lock. More...
 
void lock (void) noexcept
 Lock for single writer access. More...
 
void unlock (void) noexcept
 Unlock single writer access. More...
 

Detailed Description

A spin lock that supports multiple readers + single writer. This lock is optimized for infrequent writes and frequent reading. Its primarily used in the core library for certain plugin hooks which require write locks during the plugin's loader hooks but then requires almost exclusively reads during runtime operation.

Member Typedef Documentation

◆ SharedLock

Convenient typedef for shared lock type.

Constructor & Destructor Documentation

◆ SpinLockRW()

Pothos::Util::SpinLockRW::SpinLockRW ( void  )
inline

Create a new unlocked spin lock.

Member Function Documentation

◆ lock()

void Pothos::Util::SpinLockRW::lock ( void  )
inlinenoexcept

Lock for single writer access.

◆ lock_shared()

void Pothos::Util::SpinLockRW::lock_shared ( void  )
inlinenoexcept

Lock for multiple reader access.

◆ try_lock()

bool Pothos::Util::SpinLockRW::try_lock ( void  )
inlinenoexcept

Try to lock, return true for lock.

◆ try_lock_shared()

bool Pothos::Util::SpinLockRW::try_lock_shared ( void  )
inlinenoexcept

Try to lock shared, return true for lock.

◆ unlock()

void Pothos::Util::SpinLockRW::unlock ( void  )
inlinenoexcept

Unlock single writer access.

◆ unlock_shared()

void Pothos::Util::SpinLockRW::unlock_shared ( void  )
inlinenoexcept

Unlock from multiple reader access.


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