52 #ifndef __PCL_AutoLock_h
53 #define __PCL_AutoLock_h
58 #include <pcl/Diagnostics.h>
107 : m_mutex( x.m_mutex )
149 if ( m_mutex !=
nullptr )
150 if ( m_lock.TestAndSet( 0, 1 ) )
160 if ( m_mutex !=
nullptr )
161 if ( m_lock.TestAndSet( 1, 0 ) )
248 if ( m_count->FetchAndAdd( 1 ) >= limit-1 )
251 if ( m_count->Load() < limit )
260 : m_mutex( x.m_mutex )
261 , m_count( x.m_count )
286 if ( m_count !=
nullptr )
288 m_count->Decrement();
317 if ( m_mutex !=
nullptr )
318 if ( m_lock.TestAndSet( 0, 1 ) )
328 if ( m_mutex !=
nullptr )
329 if ( m_lock.TestAndSet( 1, 0 ) )
367 #define Synchronized( mutex, code ) \
369 pcl::AutoLock _________( mutex ); \
Atomic operations on integers.
Automatic mutex lock/unlock with limited concurrent access allowance.
AutoLockCounter(pcl::Mutex &mutex, AtomicInt &count, int limit)
AutoLockCounter(AutoLockCounter &&x)
AutoLockCounter(const AutoLockCounter &)=delete
Automatic mutex lock/unlock.
AutoLock(pcl::Mutex &mutex)
AutoLock(const AutoLock &)=delete
Adaptive mutual exclusion lock variable.