library of assembled shared sources |
http://lass.cocamware.com |
Some lock-free algorithms suffer from the ABA problem when acting on pointers. More...
#include <atomic.h>
Public Types | |
typedef num::TuintPtr | TTag |
Public Member Functions | |
TaggedPtr () | |
TaggedPtr (T *ptr, TTag tag) | |
TaggedPtr (const TaggedPtr &other) | |
TaggedPtr (const volatile TaggedPtr &other) | |
TaggedPtr & | operator= (const TaggedPtr &other) |
TaggedPtr & | operator= (const volatile TaggedPtr &other) |
T *const | get () const |
const TTag | tag () const |
bool | operator== (const TaggedPtr &other) const |
bool | operator== (const volatile TaggedPtr &other) const |
bool | atomicCompareAndSwap (const TaggedPtr &expected, const TaggedPtr &fresh) volatile |
T *const | operator-> () const |
const bool | operator! () const |
operator num::SafeBool () const | |
Private Attributes | |
T * | ptr_ |
TTag | tag_ |
Some lock-free algorithms suffer from the ABA problem when acting on pointers.
This can be solved (read: be make very unlikely) by adding a tag to the pointer.
Definition at line 141 of file atomic.h.
typedef num::TuintPtr lass::util::TaggedPtr< T >::TTag |
lass::util::TaggedPtr< T >::TaggedPtr | ( | ) | [inline] |
lass::util::TaggedPtr< T >::TaggedPtr | ( | T * | ptr, | |
TTag | tag | |||
) | [inline] |
lass::util::TaggedPtr< T >::TaggedPtr | ( | const TaggedPtr< T > & | other | ) | [inline] |
lass::util::TaggedPtr< T >::TaggedPtr | ( | const volatile TaggedPtr< T > & | other | ) | [inline] |
TaggedPtr& lass::util::TaggedPtr< T >::operator= | ( | const TaggedPtr< T > & | other | ) | [inline] |
TaggedPtr& lass::util::TaggedPtr< T >::operator= | ( | const volatile TaggedPtr< T > & | other | ) | [inline] |
T* const lass::util::TaggedPtr< T >::get | ( | ) | const [inline] |
Definition at line 196 of file atomic.h.
Referenced by lass::util::AllocatorConcurrentFreeList< FixedAllocator >::allocate(), lass::util::AllocatorConcurrentFreeList< FixedAllocator >::deallocate(), lass::stde::lock_free_queue< T, FixedAllocator >::pop(), lass::util::lock_free_stack< T, FixedAllocator >::pop_node(), lass::stde::lock_free_queue< T, FixedAllocator >::push(), lass::util::lock_free_stack< T, FixedAllocator >::push_node(), lass::util::AllocatorConcurrentFreeList< FixedAllocator >::~AllocatorConcurrentFreeList(), lass::stde::lock_free_queue< T, FixedAllocator >::~lock_free_queue(), and lass::util::lock_free_stack< T, FixedAllocator >::~lock_free_stack().
const TTag lass::util::TaggedPtr< T >::tag | ( | ) | const [inline] |
Definition at line 197 of file atomic.h.
Referenced by lass::util::AllocatorConcurrentFreeList< FixedAllocator >::allocate(), lass::util::AllocatorConcurrentFreeList< FixedAllocator >::deallocate(), lass::stde::lock_free_queue< T, FixedAllocator >::pop(), lass::util::lock_free_stack< T, FixedAllocator >::pop_node(), lass::stde::lock_free_queue< T, FixedAllocator >::push(), and lass::util::lock_free_stack< T, FixedAllocator >::push_node().
bool lass::util::TaggedPtr< T >::operator== | ( | const TaggedPtr< T > & | other | ) | const [inline] |
bool lass::util::TaggedPtr< T >::operator== | ( | const volatile TaggedPtr< T > & | other | ) | const [inline] |
bool lass::util::TaggedPtr< T >::atomicCompareAndSwap | ( | const TaggedPtr< T > & | expected, | |
const TaggedPtr< T > & | fresh | |||
) | volatile [inline] |
Definition at line 200 of file atomic.h.
Referenced by lass::util::TaggedPtr< lass::stde::lock_free_queue::node_t >::atomicCompareAndSwap(), lass::stde::lock_free_queue< T, FixedAllocator >::lock_free_queue(), lass::stde::lock_free_queue< T, FixedAllocator >::pop(), lass::util::lock_free_stack< T, FixedAllocator >::pop_node(), lass::stde::lock_free_queue< T, FixedAllocator >::push(), and lass::util::lock_free_stack< T, FixedAllocator >::push_node().
T* const lass::util::TaggedPtr< T >::operator-> | ( | ) | const [inline] |
const bool lass::util::TaggedPtr< T >::operator! | ( | ) | const [inline] |
lass::util::TaggedPtr< T >::operator num::SafeBool | ( | ) | const [inline] |
T* lass::util::TaggedPtr< T >::ptr_ [private] |
Definition at line 206 of file atomic.h.
Referenced by lass::util::TaggedPtr< lass::stde::lock_free_queue::node_t >::atomicCompareAndSwap(), lass::util::TaggedPtr< lass::stde::lock_free_queue::node_t >::get(), lass::util::TaggedPtr< lass::stde::lock_free_queue::node_t >::operator=(), and lass::util::TaggedPtr< lass::stde::lock_free_queue::node_t >::operator==().
TTag lass::util::TaggedPtr< T >::tag_ [private] |
Definition at line 207 of file atomic.h.
Referenced by lass::util::TaggedPtr< lass::stde::lock_free_queue::node_t >::atomicCompareAndSwap(), lass::util::TaggedPtr< lass::stde::lock_free_queue::node_t >::operator=(), lass::util::TaggedPtr< lass::stde::lock_free_queue::node_t >::operator==(), and lass::util::TaggedPtr< lass::stde::lock_free_queue::node_t >::tag().
Generated on Mon Nov 10 14:22:16 2008 for Library of Assembled Shared Sources by 1.5.7.1 |