Home ⌂Doc Index ◂Up ▴
Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::tricky_atomic_pointer< T > Class Template Reference

A view of a T* with additional functionality for twiddling low-order bits. More...

Inheritance diagram for tbb::tricky_atomic_pointer< T >:
Collaboration diagram for tbb::tricky_atomic_pointer< T >:

Public Types

typedef atomic_selector< sizeof(T *)>::word word
 

Public Member Functions

 tricky_atomic_pointer (T *&original)
 
 tricky_atomic_pointer (T *volatile &original)
 
T * operator & (word operand2) const
 
T * operator| (word operand2) const
 

Static Public Member Functions

template<memory_semantics M>
static T * fetch_and_add (T *volatile *location, word addend)
 
template<memory_semantics M>
static T * fetch_and_store (T *volatile *location, T *value)
 
template<memory_semantics M>
static T * compare_and_swap (T *volatile *location, T *value, T *comparand)
 

Public Attributes

T *& ref
 

Additional Inherited Members

- Private Member Functions inherited from tbb::internal::no_copy
 no_copy (const no_copy &)=delete
 
 no_copy ()=default
 

Detailed Description

template<typename T>
class tbb::tricky_atomic_pointer< T >

A view of a T* with additional functionality for twiddling low-order bits.

Definition at line 89 of file queuing_rw_mutex.cpp.

Member Typedef Documentation

◆ word

template<typename T >
typedef atomic_selector<sizeof(T*)>::word tbb::tricky_atomic_pointer< T >::word

Definition at line 91 of file queuing_rw_mutex.cpp.

Constructor & Destructor Documentation

◆ tricky_atomic_pointer() [1/2]

template<typename T >
tbb::tricky_atomic_pointer< T >::tricky_atomic_pointer ( T *&  original)
inline

Definition at line 110 of file queuing_rw_mutex.cpp.

110 : ref(original) {};

◆ tricky_atomic_pointer() [2/2]

template<typename T >
tbb::tricky_atomic_pointer< T >::tricky_atomic_pointer ( T *volatile &  original)
inline

Definition at line 111 of file queuing_rw_mutex.cpp.

111 : ref(original) {};

Member Function Documentation

◆ compare_and_swap()

template<typename T >
template<memory_semantics M>
static T* tbb::tricky_atomic_pointer< T >::compare_and_swap ( T *volatile *  location,
T *  value,
T *  comparand 
)
inlinestatic

Definition at line 102 of file queuing_rw_mutex.cpp.

102  {
103  return reinterpret_cast<T*>(
104  atomic_traits<sizeof(T*),M>::compare_and_swap(location, reinterpret_cast<word>(value),
105  reinterpret_cast<word>(comparand))
106  );
107  }
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long value
static T * compare_and_swap(T *volatile *location, T *value, T *comparand)

References value.

◆ fetch_and_add()

template<typename T >
template<memory_semantics M>
static T* tbb::tricky_atomic_pointer< T >::fetch_and_add ( T *volatile *  location,
word  addend 
)
inlinestatic

Definition at line 94 of file queuing_rw_mutex.cpp.

94  {
95  return reinterpret_cast<T*>( atomic_traits<sizeof(T*),M>::fetch_and_add(location, addend) );
96  }
static T * fetch_and_add(T *volatile *location, word addend)

◆ fetch_and_store()

template<typename T >
template<memory_semantics M>
static T* tbb::tricky_atomic_pointer< T >::fetch_and_store ( T *volatile *  location,
T *  value 
)
inlinestatic

Definition at line 98 of file queuing_rw_mutex.cpp.

98  {
99  return reinterpret_cast<T*>( atomic_traits<sizeof(T*),M>::fetch_and_store(location, reinterpret_cast<word>(value)) );
100  }
static T * fetch_and_store(T *volatile *location, T *value)
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long value

References value.

◆ operator &()

template<typename T >
T* tbb::tricky_atomic_pointer< T >::operator & ( word  operand2) const
inline

Definition at line 112 of file queuing_rw_mutex.cpp.

112  {
113  return reinterpret_cast<T*>( reinterpret_cast<word>(ref) & operand2 );
114  }

◆ operator|()

template<typename T >
T* tbb::tricky_atomic_pointer< T >::operator| ( word  operand2) const
inline

Definition at line 115 of file queuing_rw_mutex.cpp.

115  {
116  return reinterpret_cast<T*>( reinterpret_cast<word>(ref) | operand2 );
117  }

Member Data Documentation

◆ ref

template<typename T >
T* & tbb::tricky_atomic_pointer< T >::ref

Definition at line 109 of file queuing_rw_mutex.cpp.


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

Copyright © 2005-2020 Intel Corporation. All Rights Reserved.

Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

* Other names and brands may be claimed as the property of others.