[saferecl.hp.base] (original) (raw)

32 Concurrency support library [thread]

32.11 Safe reclamation [saferecl]

32.11.3 Hazard pointers [saferecl.hp]

32.11.3.3 Class template hazard_pointer_obj_base [saferecl.hp.base]

namespace std { template<class T, class D = default_delete<T>> class hazard_pointer_obj_base { public: void retire(D d = D()) noexcept;protected: hazard_pointer_obj_base() = default; hazard_pointer_obj_base(const hazard_pointer_obj_base&) = default; hazard_pointer_obj_base(hazard_pointer_obj_base&&) = default; hazard_pointer_obj_base& operator=(const hazard_pointer_obj_base&) = default; hazard_pointer_obj_base& operator=(hazard_pointer_obj_base&&) = default;~hazard_pointer_obj_base() = default;private: D deleter; };}

D shall be a function object type ([func.require]) for which, given a value d of type D and a value ptr of type T*, the expression d(ptr) is valid.

The behavior of a program that adds specializations for hazard_pointer_obj_base is undefined.

T may be an incomplete type.

It shall be complete before any member of the resulting specialization of hazard_pointer_obj_baseis referenced.

void retire(D d = D()) noexcept;

Mandates: T is a hazard-protectable type.

Preconditions: *this is a base class subobject of an object x of type T.

x is not retired.

Move-assigning d to deleter does not exit via an exception.

Effects: Move-assigns d to deleter, thereby setting it as the deleter of x, then retires x.

May reclaim possibly-reclaimable objects.