ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
ADS::FastFlowLock Class Reference

the spin lock of FastFlow, ff::lock_t, as a mutex of the standard More...

#include <ADS/parallel/FastFlowExecutor.h>

Public member functions

 FastFlowLock (void)
 an unlocked lock
 FastFlowLock (const FastFlowLock &)=delete
 no copy, as a mutex
FastFlowLock & operator= (const FastFlowLock &)=delete
 no copy, as a mutex
void lock (void)
 takes the lock: a test-and-set of its flag, retried after the exponential backoff of Backoff until it succeeds
void unlock (void)
 gives the lock back
bool try_lock (void)
 takes the lock if it is free, by one test-and-set of its flag (that of spin_lock()), and tells whether it did

Detailed description

the spin lock of FastFlow, ff::lock_t, as a mutex of the standard

Constructor and destructor documentation

◆ FastFlowLock() [1/2]

ADS::FastFlowLock::FastFlowLock ( void )
inline

an unlocked lock

◆ FastFlowLock() [2/2]

ADS::FastFlowLock::FastFlowLock ( const FastFlowLock & )
delete

no copy, as a mutex

Member function documentation

◆ lock()

void ADS::FastFlowLock::lock ( void )
inline

takes the lock: a test-and-set of its flag, retried after the exponential backoff of Backoff until it succeeds

◆ operator=()

FastFlowLock & ADS::FastFlowLock::operator= ( const FastFlowLock & )
delete

no copy, as a mutex

◆ try_lock()

bool ADS::FastFlowLock::try_lock ( void )
inline

takes the lock if it is free, by one test-and-set of its flag (that of spin_lock()), and tells whether it did

◆ unlock()

void ADS::FastFlowLock::unlock ( void )
inline

gives the lock back


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