protect overloads

Synopses

Declared in <folly/synchronization/HazptrHolder.h>

Protects and returns the pointer loaded from an atomic source, retrying until it succeeds.

template<typename T>
T*
protect(Atom<T*> const& src) noexcept;

Protects and returns a pointer loaded from an atomic source, filtered by a function, retrying until it succeeds.

template<
    typename T,
    typename Func>
T*
protect(
    Atom<T*> const& src,
    Func f) noexcept;

Return Value

The protected pointer.

Parameters

Name

Description

src

The atomic source to load the pointer from.

f

Function applied to derive the object pointer to protect.

Created with MrDocs