|
cds
1.4.0
|
Wrapper for hzp::ThreadGC class. More...
#include <cds/gc/hp.h>
Public Member Functions | |
| thread_gc (bool bPersistent=false) | |
| Constructor. More... | |
| ~thread_gc () | |
| Destructor. More... | |
Public Member Functions inherited from cds::gc::hzp::ThreadGC | |
| bool | isInitialized () const |
| Checks if thread GC is initialized. | |
| void | init () |
| Initialization. Repeat call is available. | |
| void | fini () |
| Finalization. Repeat call is available. | |
| details::HPGuard & | allocGuard () |
Initializes HP guard guard. | |
| void | freeGuard (details::HPGuard &guard) |
Frees HP guard guard. | |
| template<size_t COUNT> | |
| void | allocGuard (details::HPArray< COUNT > &arr) |
Initializes HP guard array arr. | |
| template<size_t COUNT> | |
| void | freeGuard (details::HPArray< COUNT > &arr) |
Frees HP guard array arr. | |
| template<typename T > | |
| void | retirePtr (T *p, void(*pFunc)(T *)) |
Places retired pointer and its deleter pFunc into thread's array of retired pointer for deferred reclamation. | |
| void | retirePtr (const details::retired_ptr &p) |
Places retired pointer into thread's array of retired pointer for deferred reclamation. | |
Wrapper for hzp::ThreadGC class.
This class performs automatically attaching/detaching Hazard Pointer GC for the current thread.
| cds::gc::HP::thread_gc::thread_gc | ( | bool | bPersistent = false | ) |
Constructor.
The constructor attaches the current thread to the Hazard Pointer GC if it is not yet attached. The bPersistent parameter specifies attachment persistence:
true - the class destructor will not detach the thread from Hazard Pointer GC.false (default) - the class destructor will detach the thread from Hazard Pointer GC. | cds::gc::HP::thread_gc::~thread_gc | ( | ) |
Destructor.
If the object has been created in persistent mode, the destructor does nothing. Otherwise it detaches the current thread from Hazard Pointer GC.