[saferecl.hp.holder.general] (original) (raw)

32 Concurrency support library [thread]

32.11 Safe reclamation [saferecl]

32.11.3 Hazard pointers [saferecl.hp]

32.11.3.4 Class hazard_pointer [saferecl.hp.holder]

32.11.3.4.1 General [saferecl.hp.holder.general]

namespace std { class hazard_pointer { public: hazard_pointer() noexcept; hazard_pointer(hazard_pointer&&) noexcept; hazard_pointer& operator=(hazard_pointer&&) noexcept;~hazard_pointer();bool empty() const noexcept;template<class T> T* protect(const atomic<T*>& src) noexcept;template<class T> bool try_protect(T*& ptr, const atomic<T*>& src) noexcept;template<class T> void reset_protection(const T* ptr) noexcept;void reset_protection(nullptr_t = nullptr) noexcept;void swap(hazard_pointer&) noexcept;};}

An object of type hazard_pointer is either empty orowns a hazard pointer.

Each hazard pointer is owned by exactly one object of type hazard_pointer.

[Note 1:

An empty hazard_pointer object is different from a hazard_pointer object that owns an unassociated hazard pointer.

An empty hazard_pointer object does not own any hazard pointers.

— _end note_]