proxygen
folly::hazptr_rec< Atom > Class Template Reference

#include <Hazptr-fwd.h>

Private Member Functions

const void * hazptr () const noexcept
 
FOLLY_ALWAYS_INLINE void reset_hazptr (const void *p=nullptr) noexcept
 
bool active () const noexcept
 
void set_active () noexcept
 
bool try_acquire () noexcept
 
void release () noexcept
 
hazptr_rec< Atom > * next ()
 
void set_next (hazptr_rec< Atom > *rec)
 
FOLLY_ALWAYS_INLINE hazptr_domain< Atom > * domain ()
 
void set_domain (hazptr_domain< Atom > *dom)
 

Private Attributes

Atom< const void * > hazptr_ {nullptr}
 
hazptr_domain< Atom > * domain_
 
hazptr_recnext_
 
Atom< bool > active_ {false}
 

Friends

class hazptr_domain< Atom >
 
class hazptr_holder< Atom >
 
class hazptr_tc_entry< Atom >
 

Detailed Description

template<template< typename > class Atom>
class folly::hazptr_rec< Atom >

Hazard pointer record. Defined in HazptrRec.hhazptr_rec

hazptr_rec:

Contains the actual hazard pointer.

Definition at line 42 of file Hazptr-fwd.h.

Member Function Documentation

template<template< typename > class Atom>
bool folly::hazptr_rec< Atom >::active ( ) const
inlineprivatenoexcept

Definition at line 50 of file HazptrRec.h.

50  {
51  return active_.load(std::memory_order_acquire);
52  }
Atom< bool > active_
Definition: HazptrRec.h:36
template<template< typename > class Atom>
FOLLY_ALWAYS_INLINE hazptr_domain<Atom>* folly::hazptr_rec< Atom >::domain ( )
inlineprivate

Definition at line 77 of file HazptrRec.h.

Referenced by folly::hazptr_holder< Atom >::~hazptr_holder().

77  {
78  return domain_;
79  }
hazptr_domain< Atom > * domain_
Definition: HazptrRec.h:34
template<template< typename > class Atom>
const void* folly::hazptr_rec< Atom >::hazptr ( ) const
inlineprivatenoexcept

Definition at line 42 of file HazptrRec.h.

42  {
43  return hazptr_.load(std::memory_order_acquire);
44  }
Atom< const void * > hazptr_
Definition: HazptrRec.h:33
template<template< typename > class Atom>
hazptr_rec<Atom>* folly::hazptr_rec< Atom >::next ( )
inlineprivate

Definition at line 69 of file HazptrRec.h.

69  {
70  return next_;
71  }
hazptr_rec * next_
Definition: HazptrRec.h:35
template<template< typename > class Atom>
void folly::hazptr_rec< Atom >::release ( )
inlineprivatenoexcept

Definition at line 65 of file HazptrRec.h.

65  {
66  active_.store(false, std::memory_order_release);
67  }
Atom< bool > active_
Definition: HazptrRec.h:36
template<template< typename > class Atom>
FOLLY_ALWAYS_INLINE void folly::hazptr_rec< Atom >::reset_hazptr ( const void *  p = nullptr)
inlineprivatenoexcept

Definition at line 46 of file HazptrRec.h.

Referenced by folly::hazptr_holder< Atom >::reset(), and folly::hazptr_holder< Atom >::~hazptr_holder().

46  {
47  hazptr_.store(p, std::memory_order_release);
48  }
Atom< const void * > hazptr_
Definition: HazptrRec.h:33
template<template< typename > class Atom>
void folly::hazptr_rec< Atom >::set_active ( )
inlineprivatenoexcept

Definition at line 54 of file HazptrRec.h.

Referenced by folly::hazptr_domain< DeterministicAtomic >::acquire_new_hprec().

54  {
55  active_.store(true, std::memory_order_relaxed);
56  }
Atom< bool > active_
Definition: HazptrRec.h:36
template<template< typename > class Atom>
void folly::hazptr_rec< Atom >::set_domain ( hazptr_domain< Atom > *  dom)
inlineprivate

Definition at line 81 of file HazptrRec.h.

81  {
82  domain_ = dom;
83  }
hazptr_domain< Atom > * domain_
Definition: HazptrRec.h:34
template<template< typename > class Atom>
void folly::hazptr_rec< Atom >::set_next ( hazptr_rec< Atom > *  rec)
inlineprivate

Definition at line 73 of file HazptrRec.h.

73  {
74  next_ = rec;
75  }
hazptr_rec * next_
Definition: HazptrRec.h:35
template<template< typename > class Atom>
bool folly::hazptr_rec< Atom >::try_acquire ( )
inlineprivatenoexcept

Definition at line 58 of file HazptrRec.h.

References a.

58  {
59  bool a = active();
60  return !a &&
61  active_.compare_exchange_strong(
62  a, true, std::memory_order_release, std::memory_order_relaxed);
63  }
char a
Atom< bool > active_
Definition: HazptrRec.h:36
bool active() const noexcept
Definition: HazptrRec.h:50

Friends And Related Function Documentation

template<template< typename > class Atom>
friend class hazptr_domain< Atom >
friend

Definition at line 38 of file HazptrRec.h.

template<template< typename > class Atom>
friend class hazptr_holder< Atom >
friend

Definition at line 39 of file HazptrRec.h.

template<template< typename > class Atom>
friend class hazptr_tc_entry< Atom >
friend

Definition at line 40 of file HazptrRec.h.

Member Data Documentation

template<template< typename > class Atom>
Atom<bool> folly::hazptr_rec< Atom >::active_ {false}
private

Definition at line 36 of file HazptrRec.h.

template<template< typename > class Atom>
hazptr_domain<Atom>* folly::hazptr_rec< Atom >::domain_
private

Definition at line 34 of file HazptrRec.h.

template<template< typename > class Atom>
Atom<const void*> folly::hazptr_rec< Atom >::hazptr_ {nullptr}
private

Definition at line 33 of file HazptrRec.h.

template<template< typename > class Atom>
hazptr_rec* folly::hazptr_rec< Atom >::next_
private

Definition at line 35 of file HazptrRec.h.


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