Galois
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
galois::substrate::PtrLock< T > Class Template Reference

PtrLock is a spinlock and a pointer. More...

#include <PtrLock.h>

Public Member Functions

constexpr PtrLock ()
 
 PtrLock (const PtrLock &p)
 
PtrLockoperator= (const PtrLock &p)
 
void lock ()
 
void unlock ()
 
void unlock_and_clear ()
 
void unlock_and_set (T *val)
 
T * getValue () const
 
void setValue (T *val)
 
bool try_lock ()
 
bool is_locked () const
 
bool CAS (T *oldval, T *newval)
 CAS only works on unlocked values the lock bit will prevent a successful cas. More...
 
bool stealing_CAS (T *oldval, T *newval)
 CAS that works on locked values; this can be very dangerous when used incorrectly. More...
 

Detailed Description

template<typename T>
class galois::substrate::PtrLock< T >

PtrLock is a spinlock and a pointer.

This wraps a pointer and uses the low order bit for the lock flag Copying a lock is unsynchronized (relaxed ordering)

Constructor & Destructor Documentation

template<typename T>
constexpr galois::substrate::PtrLock< T >::PtrLock ( )
inline
template<typename T>
galois::substrate::PtrLock< T >::PtrLock ( const PtrLock< T > &  p)
inline

Member Function Documentation

template<typename T>
bool galois::substrate::PtrLock< T >::CAS ( T *  oldval,
T *  newval 
)
inline

CAS only works on unlocked values the lock bit will prevent a successful cas.

template<typename T>
T* galois::substrate::PtrLock< T >::getValue ( ) const
inline
template<typename T>
bool galois::substrate::PtrLock< T >::is_locked ( ) const
inline
template<typename T>
void galois::substrate::PtrLock< T >::lock ( )
inline
template<typename T>
PtrLock& galois::substrate::PtrLock< T >::operator= ( const PtrLock< T > &  p)
inline
template<typename T>
void galois::substrate::PtrLock< T >::setValue ( T *  val)
inline
template<typename T>
bool galois::substrate::PtrLock< T >::stealing_CAS ( T *  oldval,
T *  newval 
)
inline

CAS that works on locked values; this can be very dangerous when used incorrectly.

template<typename T>
bool galois::substrate::PtrLock< T >::try_lock ( )
inline
template<typename T>
void galois::substrate::PtrLock< T >::unlock ( )
inline
template<typename T>
void galois::substrate::PtrLock< T >::unlock_and_clear ( )
inline
template<typename T>
void galois::substrate::PtrLock< T >::unlock_and_set ( T *  val)
inline

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