rpa::cas1_mutex< Iter, Mutex > Struct Template Reference

Emulates a compare-and-swap with a mutex. More...

#include <cas.h>

Inheritance diagram for rpa::cas1_mutex< Iter, Mutex >:

rpa::cas1< deque< double >::const_iterator > rpa::cas1< double_list_const_iter_t > rpa::cas1< double_vector_const_iter_t > rpa::cas1< RPA_LIST_ITERATOR(Type) > rpa::cas1< RPA_LIST_ITERATOR_CONST(Type) > rpa::cas1< RPA_SET_ITERATOR(Type) > rpa::cas1< RPA_SET_ITERATOR_CONST(Type) > rpa::cas1< RPA_VECTOR_ITERATOR(Type, Alloc) > rpa::cas1< RPA_VECTOR_ITERATOR_CONST(Type, Alloc) > rpa::cas1< set< double >::const_iterator > rpa::cas1< string_vector_const_iter_t > rpa::cas1< string_vector_iter_t > List of all members.

Static Public Member Functions

static bool cas (typename atomic< Iter >::atomic_type *ItPtr, Iter ItOld, Iter ItNew)

Static Public Attributes

static Mutex sttMtx

Detailed Description

template<class Iter, class Mutex>
struct rpa::cas1_mutex< Iter, Mutex >

Emulates a compare-and-swap with a mutex.

May seem odd because the goal of 'compare_and_swap' operations is to avoid mutexes by having atomic operations. But, when an architecture does not implement this kind of atomic operation, this class implements it with a mutex whose type can be arbitrarily chosen.


Member Function Documentation

template<class Iter, class Mutex>
static bool rpa::cas1_mutex< Iter, Mutex >::cas ( typename atomic< Iter >::atomic_type *  ItPtr,
Iter  ItOld,
Iter  ItNew 
) [inline, static]


Member Data Documentation

template<class Iter, class Mutex>
Mutex rpa::cas1_mutex< Iter, Mutex >::sttMtx [static]


The documentation for this struct was generated from the following file:
Generated on Tue Sep 25 10:20:34 2007 for rpa by  doxygen 1.4.7