32 #ifndef _GLIBCXX_PARALLEL_QUEUE_H
33 #define _GLIBCXX_PARALLEL_QUEUE_H 1
40 #define _GLIBCXX_VOLATILE volatile
42 namespace __gnu_parallel
51 template<
typename _Tp>
86 int __former_front, __former_back;
87 __decode2(__former_borders, __former_front, __former_back);
89 #if _GLIBCXX_ASSERTIONS
102 int __former_front, __former_back;
105 while (__former_front > __former_back)
129 int __former_front, __former_back;
132 while (__former_front > __former_back)
153 #undef _GLIBCXX_VOLATILE
_CASable __encode2(int __a, int __b)
Encode two integers into one gnu_parallel::_CASable.
Definition: base.h:119
_Tp __fetch_and_add(volatile _Tp *__ptr, _Tp __addend)
Add a value to a variable, atomically.
Definition: compatibility.h:74
Basic types and typedefs. This file is a GNU parallel extension to the Standard C++ Library...
Sequential helper functions. This file is a GNU parallel extension to the Standard C++ Library...
bool pop_front(_Tp &__t)
Pops one element from the queue at the front end. Must not be called concurrently with pop_front()...
Definition: queue.h:100
_Tp * _M_base
Array of elements, seen as cyclic buffer.
Definition: queue.h:56
bool pop_back(_Tp &__t)
Pops one element from the queue at the front end. Must not be called concurrently with pop_front()...
Definition: queue.h:127
_SequenceIndex _M_max_size
Maximal number of elements contained at the same time.
Definition: queue.h:59
void __decode2(_CASable __x, int &__a, int &__b)
Decode two integers from one gnu_parallel::_CASable.
Definition: base.h:133
~_RestrictedBoundedConcurrentQueue()
Destructor. Not to be called concurrent, of course.
Definition: queue.h:77
#define _GLIBCXX_VOLATILE
Decide whether to declare certain variable volatile in this file.
Definition: queue.h:40
#define _GLIBCXX_PARALLEL_ASSERT(_Condition)
Definition: base.h:422
uint64_t _SequenceIndex
Unsigned integer to index __elements. The total number of elements for each algorithm must fit into t...
Definition: types.h:117
Compatibility layer, mostly concerned with atomic operations.
_GLIBCXX_VOLATILE _CASable _M_borders
Cyclic __begin and __end pointers contained in one atomically changeable value.
Definition: queue.h:63
Double-ended queue of bounded size, allowing lock-free atomic access. push_front() and pop_front() mu...
Definition: queue.h:52
_RestrictedBoundedConcurrentQueue(_SequenceIndex __max_size)
Constructor. Not to be called concurrent, of course.
Definition: queue.h:68
bool __compare_and_swap(volatile _Tp *__ptr, _Tp __comparand, _Tp __replacement)
Compare-and-swap.
Definition: compatibility.h:108
void push_front(const _Tp &__t)
Pushes one element into the queue at the front end. Must not be called concurrently with pop_front()...
Definition: queue.h:83
int64_t _CASable
Longest compare-and-swappable integer type on this platform.
Definition: types.h:127