CNum 0.2.1
CPU-optimized ML library for C++
Loading...
Searching...
No Matches
CNum::DataStructs::HazardPointer::HazardPtrGuard Class Reference

Thread local guards for hazard pointers. More...

#include <HazardPointer.h>

Public Member Functions

 HazardPtrGuard ()
 Default constructor.
 HazardPtrGuard (const HazardPtrGuard &)=delete
HazardPtrGuardoperator= (const HazardPtrGuard &)=delete
 ~HazardPtrGuard ()
 Destructor.
HazardSlotget_slot (size_t idx)
 Get a pointer to a guard's slot.
void clear_slot (size_t idx)
 Clear one of the guard's slots.
void clear_all_slots ()
 Clear all of the guard's slots.

Detailed Description

Thread local guards for hazard pointers.

Constructor & Destructor Documentation

◆ HazardPtrGuard() [1/2]

CNum::DataStructs::HazardPointer::HazardPtrGuard::HazardPtrGuard ( )

Default constructor.

Acuires ownership of SLOTS_PER_THREAD hazard slots

◆ HazardPtrGuard() [2/2]

CNum::DataStructs::HazardPointer::HazardPtrGuard::HazardPtrGuard ( const HazardPtrGuard & )
delete

◆ ~HazardPtrGuard()

CNum::DataStructs::HazardPointer::HazardPtrGuard::~HazardPtrGuard ( )

Destructor.

Releases ownership of the hazard slots

Member Function Documentation

◆ clear_all_slots()

void CNum::DataStructs::HazardPointer::HazardPtrGuard::clear_all_slots ( )

Clear all of the guard's slots.

◆ clear_slot()

void CNum::DataStructs::HazardPointer::HazardPtrGuard::clear_slot ( size_t idx)

Clear one of the guard's slots.

Set the slots store value to nullptr

Parameters
idxThe index of the slot we want to clear

◆ get_slot()

HazardSlot * CNum::DataStructs::HazardPointer::HazardPtrGuard::get_slot ( size_t idx)

Get a pointer to a guard's slot.

Parameters
idxThe number of the slot you need the pointer of
Returns
A raw pointer to a guard's hazard slot at index idx

◆ operator=()

HazardPtrGuard & CNum::DataStructs::HazardPointer::HazardPtrGuard::operator= ( const HazardPtrGuard & )
delete

The documentation for this class was generated from the following file: