|
cds
1.3.0
|
Auto HPGuard. More...
#include <cds/gc/hzp/hzp.h>
Public Types | |
|
typedef details::HPGuard::hazard_ptr | hazard_ptr |
| Hazard pointer type. | |
Public Member Functions | |
| AutoHPGuard (ThreadGC &gc) | |
Allocates HP guard from gc. | |
| template<typename T > | |
| AutoHPGuard (ThreadGC &gc, T *p) | |
Allocates HP guard from gc and protects the pointer p of type T. | |
| ~AutoHPGuard () | |
| Frees HP guard. The pointer guarded may be deleted after this. | |
| ThreadGC & | getGC () const |
| Returns thread GC. | |
| template<typename T > | |
| T * | operator= (T *p) |
Protects the pointer p against reclamation (guards the pointer). | |
Auto HPGuard.
This class encapsulates Hazard Pointer guard to protect a pointer against deletion . It allocates one HP from thread's HP array in constructor and free the HP allocated in destruction time.