proxygen
folly::hazptr_obj< Atom > Class Template Reference

#include <Hazptr-fwd.h>

Inheritance diagram for folly::hazptr_obj< Atom >:
folly::hazptr_obj_base< T, Atom, D > folly::hazptr_obj_linked< Atom > folly::hazptr_obj_base< Buckets, Atom, concurrenthashmap::HazptrBucketDeleter< Allocator > > folly::hazptr_obj_base< Node, Atom > folly::hazptr_obj_base< Node, Atom, Reclaimer< Node > > folly::hazptr_obj_base< Node< Atom >, Atom > folly::hazptr_obj_base< Slots > folly::hazptr_obj_base_linked< T, Atom, D > folly::hazptr_obj_base_linked< NodeAuto< Atom >, Atom > folly::hazptr_obj_base_linked< NodeRC< Mutable, Atom >, Atom > folly::hazptr_obj_base_linked< NodeT< KeyType, ValueType, Allocator, Atom >, Atom, concurrenthashmap::HazptrDeleter< Allocator > > folly::hazptr_obj_base_linked< Segment, Atom > folly::detail::ConcurrentHashMapSegment< KeyType, ValueType, ShardBits, HashFn, KeyEqual, Allocator, Atom, Mutex >::Buckets folly::HazptrLockFreeLIFO< T, Atom >::Node folly::HazptrWideCAS< T, Atom >::Node folly::RelaxedConcurrentPriorityQueue< T, MayBlock, SupportsSize, PopBatch, ListTargetSize, Mutex, Atom >::Node folly::HazptrSWMRSet< T, Atom >::Node Node< Atom > folly::AtomicCoreCachedSharedPtr< T, kNumSlots >::Slots

Public Member Functions

 hazptr_obj () noexcept
 
 hazptr_obj (const hazptr_obj< Atom > &) noexcept
 
 hazptr_obj (hazptr_obj< Atom > &&) noexcept
 
hazptr_obj< Atom > & operator= (const hazptr_obj< Atom > &) noexcept
 
hazptr_obj< Atom > & operator= (hazptr_obj< Atom > &&) noexcept
 

Private Types

using ReclaimFnPtr = void(*)(hazptr_obj< Atom > *, hazptr_obj_list< Atom > &)
 

Private Member Functions

hazptr_obj< Atom > * next () const noexcept
 
void set_next (hazptr_obj *obj) noexcept
 
ReclaimFnPtr reclaim () noexcept
 
const void * raw_ptr () const
 
void pre_retire_check () noexcept
 
void push_to_retired (hazptr_domain< Atom > &domain)
 
FOLLY_NOINLINE void pre_retire_check_fail () noexcept
 

Private Attributes

ReclaimFnPtr reclaim_
 
hazptr_obj< Atom > * next_
 

Friends

template<template< typename > class>
class hazptr_domain
 
template<typename , template< typename > class, typename >
class hazptr_obj_base
 
template<typename , template< typename > class, typename >
class hazptr_obj_base_linked
 
template<template< typename > class>
class hazptr_obj_list
 
template<template< typename > class>
class hazptr_priv
 
class hazptr_domain< Atom >
 
template<typename , template< typename > class, typename >
class hazptr_obj_base_refcounted
 
class hazptr_priv< Atom >
 
template<typename , template< typename > class, typename >
class hazptr_obj_base
 

Detailed Description

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

Classes related to objects protected by hazard pointers. Defined in HazptrObj.hhazptr_obj

hazptr_obj

Object protected by hazard pointers.

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

Member Typedef Documentation

template<template< typename > class Atom>
using folly::hazptr_obj< Atom >::ReclaimFnPtr = void (*)(hazptr_obj<Atom>*, hazptr_obj_list<Atom>&)
private

Definition at line 41 of file HazptrObj.h.

Constructor & Destructor Documentation

template<template< typename > class Atom>
folly::hazptr_obj< Atom >::hazptr_obj ( )
inlinenoexcept

Constructors

Definition at line 62 of file HazptrObj.h.

62 : next_(this) {}
hazptr_obj< Atom > * next_
Definition: HazptrObj.h:55
template<template< typename > class Atom>
folly::hazptr_obj< Atom >::hazptr_obj ( const hazptr_obj< Atom > &  )
inlinenoexcept

Definition at line 64 of file HazptrObj.h.

64 : next_(this) {}
hazptr_obj< Atom > * next_
Definition: HazptrObj.h:55
template<template< typename > class Atom>
folly::hazptr_obj< Atom >::hazptr_obj ( hazptr_obj< Atom > &&  )
inlinenoexcept

Definition at line 66 of file HazptrObj.h.

66 : next_(this) {}
hazptr_obj< Atom > * next_
Definition: HazptrObj.h:55

Member Function Documentation

template<template< typename > class Atom>
hazptr_obj<Atom>* folly::hazptr_obj< Atom >::next ( ) const
inlineprivatenoexcept

Definition at line 86 of file HazptrObj.h.

References folly::hazptr_obj< Atom >::next_.

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

86  {
87  return next_;
88  }
hazptr_obj< Atom > * next_
Definition: HazptrObj.h:55
template<template< typename > class Atom>
hazptr_obj<Atom>& folly::hazptr_obj< Atom >::operator= ( const hazptr_obj< Atom > &  )
inlinenoexcept

Copy operator

Definition at line 69 of file HazptrObj.h.

69  {
70  return *this;
71  }
template<template< typename > class Atom>
hazptr_obj<Atom>& folly::hazptr_obj< Atom >::operator= ( hazptr_obj< Atom > &&  )
inlinenoexcept

Move operator

Definition at line 74 of file HazptrObj.h.

74  {
75  return *this;
76  }
template<template< typename > class Atom>
void folly::hazptr_obj< Atom >::pre_retire_check ( )
inlineprivatenoexcept

Definition at line 102 of file HazptrObj.h.

References folly::hazptr_obj< Atom >::pre_retire_check_fail().

Referenced by folly::hazptr_obj_base< Node, Atom >::pre_retire().

102  {
103  // Only for catching misuse bugs like double retire
104  if (next_ != this) {
106  }
107  }
FOLLY_NOINLINE void pre_retire_check_fail() noexcept
Definition: HazptrObj.h:120
hazptr_obj< Atom > * next_
Definition: HazptrObj.h:55
template<template< typename > class Atom>
FOLLY_NOINLINE void folly::hazptr_obj< Atom >::pre_retire_check_fail ( )
inlineprivatenoexcept

Definition at line 120 of file HazptrObj.h.

References Atom.

Referenced by folly::hazptr_obj< Atom >::pre_retire_check().

120  {
121  CHECK_EQ(next_, this);
122  }
hazptr_obj< Atom > * next_
Definition: HazptrObj.h:55
template<template< typename > class Atom>
void folly::hazptr_obj< Atom >::push_to_retired ( hazptr_domain< Atom > &  domain)
inlineprivate

Definition at line 109 of file HazptrObj.h.

References folly::hazptr_domain_push_retired(), and folly::hazptr_domain< Atom >::shutdown_.

Referenced by folly::hazptr_obj_base< Node, Atom >::retire().

109  {
110 #if FOLLY_HAZPTR_THR_LOCAL
111  if (&domain == &default_hazptr_domain<Atom>() && !domain.shutdown_) {
112  hazptr_priv_tls<Atom>().push(this);
113  return;
114  }
115 #endif
116  hazptr_obj_list<Atom> l(this);
117  hazptr_domain_push_retired(l, true, domain);
118  }
void hazptr_domain_push_retired(hazptr_obj_list< Atom > &l, bool check=true, hazptr_domain< Atom > &domain=default_hazptr_domain< Atom >()) noexcept
Definition: HazptrDomain.h:369
template<template< typename > class Atom>
const void* folly::hazptr_obj< Atom >::raw_ptr ( ) const
inlineprivate

Definition at line 98 of file HazptrObj.h.

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

98  {
99  return this;
100  }
template<template< typename > class Atom>
ReclaimFnPtr folly::hazptr_obj< Atom >::reclaim ( )
inlineprivatenoexcept

Definition at line 94 of file HazptrObj.h.

References folly::hazptr_obj< Atom >::reclaim_.

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

94  {
95  return reclaim_;
96  }
ReclaimFnPtr reclaim_
Definition: HazptrObj.h:54
template<template< typename > class Atom>
void folly::hazptr_obj< Atom >::set_next ( hazptr_obj< Atom > *  obj)
inlineprivatenoexcept

Definition at line 90 of file HazptrObj.h.

90  {
91  next_ = obj;
92  }
hazptr_obj< Atom > * next_
Definition: HazptrObj.h:55

Friends And Related Function Documentation

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

Definition at line 44 of file HazptrObj.h.

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

Definition at line 79 of file HazptrObj.h.

template<template< typename > class Atom>
template<typename , template< typename > class, typename >
friend class hazptr_obj_base
friend

Definition at line 46 of file HazptrObj.h.

template<template< typename > class Atom>
template<typename , template< typename > class, typename >
class hazptr_obj_base ( )
friend

Definition at line 81 of file HazptrObj.h.

template<template< typename > class Atom>
template<typename , template< typename > class, typename >
friend class hazptr_obj_base_linked
friend

Definition at line 48 of file HazptrObj.h.

template<template< typename > class Atom>
template<typename , template< typename > class, typename >
friend class hazptr_obj_base_refcounted
friend

Definition at line 83 of file HazptrObj.h.

template<template< typename > class Atom>
template<template< typename > class>
friend class hazptr_obj_list
friend

Definition at line 50 of file HazptrObj.h.

template<template< typename > class Atom>
template<template< typename > class>
friend class hazptr_priv
friend

Definition at line 52 of file HazptrObj.h.

template<template< typename > class Atom>
friend class hazptr_priv< Atom >
friend

Definition at line 84 of file HazptrObj.h.

Member Data Documentation

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

Definition at line 55 of file HazptrObj.h.

Referenced by folly::hazptr_obj< Atom >::next().

template<template< typename > class Atom>
ReclaimFnPtr folly::hazptr_obj< Atom >::reclaim_
private

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