|
cds
1.4.0
|
Array of guards. More...
#include <cds/gc/hrc.h>
Data Structures | |
| struct | rebind |
Rebind array for other size OtherLimit. More... | |
Public Member Functions | |
| template<typename T > | |
| T * | protect (size_t nIndex, atomic_ref< T > const &link) |
Protects an atomic reference link in slot nIndex. More... | |
| template<typename T > | |
| atomic_marked_ptr< T >::marked_ptr | protect (size_t nIndex, atomic_marked_ptr< T > const &link) |
Protects a atomic marked reference link in slot nIndex. More... | |
| template<typename T , class Func > | |
| T * | protect (size_t nIndex, atomic_ref< T > const &toGuard, Func f) |
Protects a pointer of type atomic<T*> More... | |
| template<typename T , typename Func > | |
| atomic_marked_ptr< T >::marked_ptr | protect (size_t nIndex, atomic_marked_ptr< T > const &link, Func f) |
Protects a atomic marked reference link in slot nIndex. More... | |
| template<typename T > | |
| T * | assign (size_t nIndex, T *p) |
Store to the slot nIndex. More... | |
| template<typename T , int Bitmask> | |
| T * | assign (size_t nIndex, cds::details::marked_ptr< T, Bitmask > p) |
Store marked pointer p to the guard. More... | |
| void | copy (size_t nIndex, Guard const &src) |
Copy guarded value from src guard to slot at index nIndex. | |
| void | copy (size_t nDestIndex, size_t nSrcIndex) |
Copy guarded value from slot nSrcIndex to slot at index nDestIndex. | |
| void | clear (size_t nIndex) |
Clear value of the slot nIndex. | |
| template<typename T > | |
| T * | get (size_t nIndex) const |
Get current value of slot nIndex. | |
| guarded_pointer | get_native (size_t nIndex) const |
| Get native hazard pointer stored. | |
Public Member Functions inherited from cds::gc::hrc::AutoHPArray< Limit > | |
| AutoHPArray (ThreadGC &mgr) | |
Allocates array of HP guard from mgr. | |
| ~AutoHPArray () | |
| Frees array of HP guard. | |
| ThreadGC & | getGC () const |
| Returns thread GC. | |
Static Public Member Functions | |
| static constexpr size_t | capacity () |
| Capacity of the guard array. | |
Array of guards.
This class is a wrapper for AutoHPArray template. Template parameter Limit defines the size of HP array.
|
inline |
Store to the slot nIndex.
The function equals to a simple assignment, no loop is performed.
|
inline |
Store marked pointer p to the guard.
The function equals to a simple assignment of p.ptr(), no loop is performed. Can be used for a marked pointer that cannot be changed concurrently.
|
inline |
Protects an atomic reference link in slot nIndex.
Returns current value of link.
The function tries to load pToGuard and to store it to the slot nIndex repeatedly until the guard's value equals pToGuard
|
inline |
Protects a atomic marked reference link in slot nIndex.
Returns current value of link.
The function tries to load link and to store it to the slot nIndex repeatedly until the guard's value equals link
|
inline |
Protects a pointer of type atomic<T*>
Return the value of toGuard
The function tries to load toGuard and to store it to the slot nIndex repeatedly until the guard's value equals toGuard
The function is useful for intrusive containers when toGuard is a node pointer that should be converted to a pointer to the value type before guarding. The parameter f of type Func is a functor that makes this conversion:
Really, the result of f( toGuard.load() ) is assigned to the hazard pointer.
|
inline |
Protects a atomic marked reference link in slot nIndex.
Returns current value of link.
The function tries to load link and to store it to the slot nIndex repeatedly until the guard's value equals link
The function is useful for intrusive containers when link is a node pointer that should be converted to a pointer to the value type before guarding. The parameter f of type Func is a functor that makes this conversion:
Really, the result of f( link.load() ) is assigned to the hazard pointer.