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.

: ref(original) {};
tbb::tricky_atomic_pointer::ref
T *& ref
Definition: queuing_rw_mutex.cpp:109

## 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.

: 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
| ) |  |

inline static

Definition at line 102 of file queuing_rw_mutex.cpp.

{
return reinterpret_cast<T*>(
atomic_traits<sizeof(T*),M>::compare_and_swap(location, reinterpret_cast<word>(value),
reinterpret_cast<word>(comparand))
);
}
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
Definition: ittnotify_static.h:192
tbb::tricky_atomic_pointer::compare_and_swap
static T * compare_and_swap(T *volatile *location, T *value, T *comparand)
Definition: queuing_rw_mutex.cpp:102
tbb::tricky_atomic_pointer::word
atomic_selector< sizeof(T *)>::word word
Definition: queuing_rw_mutex.cpp:91

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
| ) |  |

inline static

Definition at line 94 of file queuing_rw_mutex.cpp.

{
return reinterpret_cast<T*>( atomic_traits<sizeof(T*),M>::fetch_and_add(location, addend) );
}
tbb::tricky_atomic_pointer::fetch_and_add
static T * fetch_and_add(T *volatile *location, word addend)
Definition: queuing_rw_mutex.cpp:94

## 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
| ) |  |

inline static

Definition at line 98 of file queuing_rw_mutex.cpp.

{
return reinterpret_cast<T*>( atomic_traits<sizeof(T*),M>::fetch_and_store(location, reinterpret_cast<word>(value)) );
}
tbb::tricky_atomic_pointer::fetch_and_store
static T * fetch_and_store(T *volatile *location, T *value)
Definition: queuing_rw_mutex.cpp:98

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.

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

## 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.

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

## 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:

- queuing_rw_mutex.cpp

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.