CARLA
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
moodycamel::ConcurrentQueue< T, Traits > Class Template Reference

#include <ConcurrentQueue.h>

+ Inheritance diagram for moodycamel::ConcurrentQueue< T, Traits >:
+ Collaboration diagram for moodycamel::ConcurrentQueue< T, Traits >:

Classes

struct  Block
 
struct  ExplicitProducer
 
struct  FreeList
 
struct  FreeListNode
 
struct  ImplicitProducer
 
struct  ImplicitProducerHash
 
struct  ImplicitProducerKVP
 
struct  ProducerBase
 

Public Types

typedef ::moodycamel::ConsumerToken consumer_token_t
 
typedef Traits::index_t index_t
 
typedef ::moodycamel::ProducerToken producer_token_t
 
typedef Traits::size_t size_t
 

Public Member Functions

 ConcurrentQueue (size_t capacity=6 *BLOCK_SIZE)
 
 ConcurrentQueue (size_t minCapacity, size_t maxExplicitProducers, size_t maxImplicitProducers)
 
 ConcurrentQueue (ConcurrentQueue const &) MOODYCAMEL_DELETE_FUNCTION
 
 ConcurrentQueue (ConcurrentQueue &&other) MOODYCAMEL_NOEXCEPT
 
bool enqueue (T const &item)
 
bool enqueue (T &&item)
 
bool enqueue (producer_token_t const &token, T const &item)
 
bool enqueue (producer_token_t const &token, T &&item)
 
template<typename It >
bool enqueue_bulk (It itemFirst, size_t count)
 
template<typename It >
bool enqueue_bulk (producer_token_t const &token, It itemFirst, size_t count)
 
ConcurrentQueueoperator= (ConcurrentQueue const &) MOODYCAMEL_DELETE_FUNCTION
 
ConcurrentQueueoperator= (ConcurrentQueue &&other) MOODYCAMEL_NOEXCEPT
 
size_t size_approx () const
 
void swap (ConcurrentQueue &other) MOODYCAMEL_NOEXCEPT
 
template<typename U >
bool try_dequeue (U &item)
 
template<typename U >
bool try_dequeue (consumer_token_t &token, U &item)
 
template<typename It >
size_t try_dequeue_bulk (It itemFirst, size_t max)
 
template<typename It >
size_t try_dequeue_bulk (consumer_token_t &token, It itemFirst, size_t max)
 
template<typename It >
size_t try_dequeue_bulk_from_producer (producer_token_t const &producer, It itemFirst, size_t max)
 
template<typename U >
bool try_dequeue_from_producer (producer_token_t const &producer, U &item)
 
template<typename U >
bool try_dequeue_non_interleaved (U &item)
 
bool try_enqueue (T const &item)
 
bool try_enqueue (T &&item)
 
bool try_enqueue (producer_token_t const &token, T const &item)
 
bool try_enqueue (producer_token_t const &token, T &&item)
 
template<typename It >
bool try_enqueue_bulk (It itemFirst, size_t count)
 
template<typename It >
bool try_enqueue_bulk (producer_token_t const &token, It itemFirst, size_t count)
 
 ~ConcurrentQueue ()
 

Static Public Member Functions

static bool is_lock_free ()
 

Static Public Attributes

static const size_t BLOCK_SIZE = static_cast<size_t>(Traits::BLOCK_SIZE)
 
static const size_t EXPLICIT_BLOCK_EMPTY_COUNTER_THRESHOLD = static_cast<size_t>(Traits::EXPLICIT_BLOCK_EMPTY_COUNTER_THRESHOLD)
 
static const std::uint32_t EXPLICIT_CONSUMER_CONSUMPTION_QUOTA_BEFORE_ROTATE = static_cast<std::uint32_t>(Traits::EXPLICIT_CONSUMER_CONSUMPTION_QUOTA_BEFORE_ROTATE)
 
static const size_t EXPLICIT_INITIAL_INDEX_SIZE = static_cast<size_t>(Traits::EXPLICIT_INITIAL_INDEX_SIZE)
 
static const size_t IMPLICIT_INITIAL_INDEX_SIZE = static_cast<size_t>(Traits::IMPLICIT_INITIAL_INDEX_SIZE)
 
static const size_t INITIAL_IMPLICIT_PRODUCER_HASH_SIZE = static_cast<size_t>(Traits::INITIAL_IMPLICIT_PRODUCER_HASH_SIZE)
 
static const size_t MAX_SUBQUEUE_SIZE = (details::const_numeric_max<size_t>::value - static_cast<size_t>(Traits::MAX_SUBQUEUE_SIZE) < BLOCK_SIZE) ? details::const_numeric_max<size_t>::value : ((static_cast<size_t>(Traits::MAX_SUBQUEUE_SIZE) + (BLOCK_SIZE - 1)) / BLOCK_SIZE * BLOCK_SIZE)
 

Private Types

enum  AllocationMode { CanAlloc, CannotAlloc }
 
enum  InnerQueueContext { implicit_context = 0, explicit_context = 1 }
 

Private Member Functions

void add_block_to_free_list (Block *block)
 
void add_blocks_to_free_list (Block *block)
 
ProducerBaseadd_producer (ProducerBase *producer)
 
ImplicitProducerget_or_add_implicit_producer ()
 
template<AllocationMode canAlloc, typename U >
bool inner_enqueue (producer_token_t const &token, U &&element)
 
template<AllocationMode canAlloc, typename U >
bool inner_enqueue (U &&element)
 
template<AllocationMode canAlloc, typename It >
bool inner_enqueue_bulk (producer_token_t const &token, It itemFirst, size_t count)
 
template<AllocationMode canAlloc, typename It >
bool inner_enqueue_bulk (It itemFirst, size_t count)
 
void populate_initial_block_list (size_t blockCount)
 
void populate_initial_implicit_producer_hash ()
 
ProducerBaserecycle_or_create_producer (bool isExplicit)
 
ProducerBaserecycle_or_create_producer (bool isExplicit, bool &recycled)
 
void reown_producers ()
 
template<AllocationMode canAlloc>
Blockrequisition_block ()
 
void swap_implicit_producer_hashes (ConcurrentQueue &other)
 
ConcurrentQueueswap_internal (ConcurrentQueue &other)
 
Blocktry_get_block_from_free_list ()
 
Blocktry_get_block_from_initial_pool ()
 
bool update_current_producer_after_rotation (consumer_token_t &token)
 

Static Private Member Functions

template<typename U >
static U * create ()
 
template<typename U , typename A1 >
static U * create (A1 &&a1)
 
template<typename U >
static U * create_array (size_t count)
 
template<typename U >
static void destroy (U *p)
 
template<typename U >
static void destroy_array (U *p, size_t count)
 

Private Attributes

FreeList< BlockfreeList
 
std::atomic< std::uint32_t > globalExplicitConsumerOffset
 
std::atomic< ImplicitProducerHash * > implicitProducerHash
 
std::atomic< size_timplicitProducerHashCount
 
std::atomic_flag implicitProducerHashResizeInProgress
 
BlockinitialBlockPool
 
std::atomic< size_tinitialBlockPoolIndex
 
size_t initialBlockPoolSize
 
ImplicitProducerHash initialImplicitProducerHash
 
std::array< ImplicitProducerKVP, INITIAL_IMPLICIT_PRODUCER_HASH_SIZEinitialImplicitProducerHashEntries
 
std::atomic< std::uint32_t > nextExplicitConsumerId
 
std::atomic< std::uint32_t > producerCount
 
std::atomic< ProducerBase * > producerListTail
 

Friends

class ConcurrentQueueTests
 
struct ConsumerToken
 
struct ExplicitProducer
 
struct ImplicitProducer
 
template<typename XT , typename XTraits >
void moodycamel::swap (typename ConcurrentQueue< XT, XTraits >::ImplicitProducerKVP &, typename ConcurrentQueue< XT, XTraits >::ImplicitProducerKVP &) MOODYCAMEL_NOEXCEPT
 
struct ProducerToken
 

Detailed Description

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
class moodycamel::ConcurrentQueue< T, Traits >

Definition at line 365 of file ConcurrentQueue.h.

Member Typedef Documentation

◆ consumer_token_t

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
typedef ::moodycamel::ConsumerToken moodycamel::ConcurrentQueue< T, Traits >::consumer_token_t

Definition at line 699 of file ConcurrentQueue.h.

◆ index_t

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
typedef Traits::index_t moodycamel::ConcurrentQueue< T, Traits >::index_t

Definition at line 701 of file ConcurrentQueue.h.

◆ producer_token_t

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
typedef ::moodycamel::ProducerToken moodycamel::ConcurrentQueue< T, Traits >::producer_token_t

Definition at line 698 of file ConcurrentQueue.h.

◆ size_t

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
typedef Traits::size_t moodycamel::ConcurrentQueue< T, Traits >::size_t

Definition at line 702 of file ConcurrentQueue.h.

Member Enumeration Documentation

◆ AllocationMode

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
enum moodycamel::ConcurrentQueue::AllocationMode
private
Enumerator
CanAlloc 
CannotAlloc 

Definition at line 1287 of file ConcurrentQueue.h.

◆ InnerQueueContext

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
enum moodycamel::ConcurrentQueue::InnerQueueContext
private
Enumerator
implicit_context 
explicit_context 

Definition at line 1485 of file ConcurrentQueue.h.

Constructor & Destructor Documentation

◆ ConcurrentQueue() [1/4]

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
moodycamel::ConcurrentQueue< T, Traits >::ConcurrentQueue ( size_t  capacity = 6 * BLOCK_SIZE)
inlineexplicit

Definition at line 741 of file ConcurrentQueue.h.

◆ ConcurrentQueue() [2/4]

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
moodycamel::ConcurrentQueue< T, Traits >::ConcurrentQueue ( size_t  minCapacity,
size_t  maxExplicitProducers,
size_t  maxImplicitProducers 
)
inline

Definition at line 765 of file ConcurrentQueue.h.

◆ ~ConcurrentQueue()

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
moodycamel::ConcurrentQueue< T, Traits >::~ConcurrentQueue ( )
inline

Definition at line 786 of file ConcurrentQueue.h.

◆ ConcurrentQueue() [3/4]

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
moodycamel::ConcurrentQueue< T, Traits >::ConcurrentQueue ( ConcurrentQueue< T, Traits > const &  )

◆ ConcurrentQueue() [4/4]

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
moodycamel::ConcurrentQueue< T, Traits >::ConcurrentQueue ( ConcurrentQueue< T, Traits > &&  other)
inline

Definition at line 839 of file ConcurrentQueue.h.

Member Function Documentation

◆ add_block_to_free_list()

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
void moodycamel::ConcurrentQueue< T, Traits >::add_block_to_free_list ( Block block)
inlineprivate

Definition at line 2989 of file ConcurrentQueue.h.

Referenced by moodycamel::ConcurrentQueue< T, Traits >::ImplicitProducer::dequeue().

+ Here is the caller graph for this function:

◆ add_blocks_to_free_list()

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
void moodycamel::ConcurrentQueue< T, Traits >::add_blocks_to_free_list ( Block block)
inlineprivate

Definition at line 2997 of file ConcurrentQueue.h.

◆ add_producer()

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
ProducerBase* moodycamel::ConcurrentQueue< T, Traits >::add_producer ( ProducerBase producer)
inlineprivate

Definition at line 3170 of file ConcurrentQueue.h.

◆ create() [1/2]

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
template<typename U >
static U* moodycamel::ConcurrentQueue< T, Traits >::create ( )
inlinestaticprivate

Definition at line 3531 of file ConcurrentQueue.h.

◆ create() [2/2]

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
template<typename U , typename A1 >
static U* moodycamel::ConcurrentQueue< T, Traits >::create ( A1 &&  a1)
inlinestaticprivate

Definition at line 3538 of file ConcurrentQueue.h.

◆ create_array()

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
template<typename U >
static U* moodycamel::ConcurrentQueue< T, Traits >::create_array ( size_t  count)
inlinestaticprivate

Definition at line 3504 of file ConcurrentQueue.h.

◆ destroy()

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
template<typename U >
static void moodycamel::ConcurrentQueue< T, Traits >::destroy ( U *  p)
inlinestaticprivate

Definition at line 3545 of file ConcurrentQueue.h.

◆ destroy_array()

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
template<typename U >
static void moodycamel::ConcurrentQueue< T, Traits >::destroy_array ( U *  p,
size_t  count 
)
inlinestaticprivate

Definition at line 3519 of file ConcurrentQueue.h.

◆ enqueue() [1/4]

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
bool moodycamel::ConcurrentQueue< T, Traits >::enqueue ( T const &  item)
inline

Definition at line 923 of file ConcurrentQueue.h.

◆ enqueue() [2/4]

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
bool moodycamel::ConcurrentQueue< T, Traits >::enqueue ( T &&  item)
inline

Definition at line 934 of file ConcurrentQueue.h.

◆ enqueue() [3/4]

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
bool moodycamel::ConcurrentQueue< T, Traits >::enqueue ( producer_token_t const &  token,
T const &  item 
)
inline

Definition at line 944 of file ConcurrentQueue.h.

◆ enqueue() [4/4]

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
bool moodycamel::ConcurrentQueue< T, Traits >::enqueue ( producer_token_t const &  token,
T &&  item 
)
inline

Definition at line 953 of file ConcurrentQueue.h.

◆ enqueue_bulk() [1/2]

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
template<typename It >
bool moodycamel::ConcurrentQueue< T, Traits >::enqueue_bulk ( It  itemFirst,
size_t  count 
)
inline

Definition at line 965 of file ConcurrentQueue.h.

◆ enqueue_bulk() [2/2]

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
template<typename It >
bool moodycamel::ConcurrentQueue< T, Traits >::enqueue_bulk ( producer_token_t const &  token,
It  itemFirst,
size_t  count 
)
inline

Definition at line 978 of file ConcurrentQueue.h.

◆ get_or_add_implicit_producer()

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
ImplicitProducer* moodycamel::ConcurrentQueue< T, Traits >::get_or_add_implicit_producer ( )
inlineprivate

Definition at line 3306 of file ConcurrentQueue.h.

◆ inner_enqueue() [1/2]

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
template<AllocationMode canAlloc, typename U >
bool moodycamel::ConcurrentQueue< T, Traits >::inner_enqueue ( producer_token_t const &  token,
U &&  element 
)
inlineprivate

Definition at line 1295 of file ConcurrentQueue.h.

◆ inner_enqueue() [2/2]

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
template<AllocationMode canAlloc, typename U >
bool moodycamel::ConcurrentQueue< T, Traits >::inner_enqueue ( U &&  element)
inlineprivate

Definition at line 1301 of file ConcurrentQueue.h.

◆ inner_enqueue_bulk() [1/2]

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
template<AllocationMode canAlloc, typename It >
bool moodycamel::ConcurrentQueue< T, Traits >::inner_enqueue_bulk ( producer_token_t const &  token,
It  itemFirst,
size_t  count 
)
inlineprivate

Definition at line 1308 of file ConcurrentQueue.h.

◆ inner_enqueue_bulk() [2/2]

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
template<AllocationMode canAlloc, typename It >
bool moodycamel::ConcurrentQueue< T, Traits >::inner_enqueue_bulk ( It  itemFirst,
size_t  count 
)
inlineprivate

Definition at line 1314 of file ConcurrentQueue.h.

◆ is_lock_free()

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
static bool moodycamel::ConcurrentQueue< T, Traits >::is_lock_free ( )
inlinestatic

Definition at line 1266 of file ConcurrentQueue.h.

◆ operator=() [1/2]

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
ConcurrentQueue& moodycamel::ConcurrentQueue< T, Traits >::operator= ( ConcurrentQueue< T, Traits > const &  )

◆ operator=() [2/2]

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
ConcurrentQueue& moodycamel::ConcurrentQueue< T, Traits >::operator= ( ConcurrentQueue< T, Traits > &&  other)
inline

Definition at line 873 of file ConcurrentQueue.h.

◆ populate_initial_block_list()

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
void moodycamel::ConcurrentQueue< T, Traits >::populate_initial_block_list ( size_t  blockCount)
inlineprivate

Definition at line 2961 of file ConcurrentQueue.h.

◆ populate_initial_implicit_producer_hash()

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
void moodycamel::ConcurrentQueue< T, Traits >::populate_initial_implicit_producer_hash ( )
inlineprivate

Definition at line 3256 of file ConcurrentQueue.h.

◆ recycle_or_create_producer() [1/2]

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
ProducerBase* moodycamel::ConcurrentQueue< T, Traits >::recycle_or_create_producer ( bool  isExplicit)
inlineprivate

Definition at line 3143 of file ConcurrentQueue.h.

◆ recycle_or_create_producer() [2/2]

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
ProducerBase* moodycamel::ConcurrentQueue< T, Traits >::recycle_or_create_producer ( bool  isExplicit,
bool &  recycled 
)
inlineprivate

Definition at line 3149 of file ConcurrentQueue.h.

◆ reown_producers()

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
void moodycamel::ConcurrentQueue< T, Traits >::reown_producers ( )
inlineprivate

Definition at line 3203 of file ConcurrentQueue.h.

Referenced by moodycamel::ConcurrentQueue< carla::Buffer >::swap_internal().

+ Here is the caller graph for this function:

◆ requisition_block()

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
template<AllocationMode canAlloc>
Block* moodycamel::ConcurrentQueue< T, Traits >::requisition_block ( )
inlineprivate

Definition at line 3013 of file ConcurrentQueue.h.

◆ size_approx()

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
size_t moodycamel::ConcurrentQueue< T, Traits >::size_approx ( ) const
inline

Definition at line 1253 of file ConcurrentQueue.h.

Referenced by moodycamel::ConcurrentQueue< carla::Buffer >::requisition_block().

+ Here is the caller graph for this function:

◆ swap()

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
void moodycamel::ConcurrentQueue< T, Traits >::swap ( ConcurrentQueue< T, Traits > &  other)
inline

Definition at line 883 of file ConcurrentQueue.h.

◆ swap_implicit_producer_hashes()

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
void moodycamel::ConcurrentQueue< T, Traits >::swap_implicit_producer_hashes ( ConcurrentQueue< T, Traits > &  other)
inlineprivate

Definition at line 3271 of file ConcurrentQueue.h.

◆ swap_internal()

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
ConcurrentQueue& moodycamel::ConcurrentQueue< T, Traits >::swap_internal ( ConcurrentQueue< T, Traits > &  other)
inlineprivate

Definition at line 889 of file ConcurrentQueue.h.

◆ try_dequeue() [1/2]

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
template<typename U >
bool moodycamel::ConcurrentQueue< T, Traits >::try_dequeue ( U &  item)
inline

Definition at line 1053 of file ConcurrentQueue.h.

◆ try_dequeue() [2/2]

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
template<typename U >
bool moodycamel::ConcurrentQueue< T, Traits >::try_dequeue ( consumer_token_t token,
U &  item 
)
inline

Definition at line 1111 of file ConcurrentQueue.h.

◆ try_dequeue_bulk() [1/2]

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
template<typename It >
size_t moodycamel::ConcurrentQueue< T, Traits >::try_dequeue_bulk ( It  itemFirst,
size_t  max 
)
inline

Definition at line 1159 of file ConcurrentQueue.h.

◆ try_dequeue_bulk() [2/2]

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
template<typename It >
size_t moodycamel::ConcurrentQueue< T, Traits >::try_dequeue_bulk ( consumer_token_t token,
It  itemFirst,
size_t  max 
)
inline

Definition at line 1177 of file ConcurrentQueue.h.

◆ try_dequeue_bulk_from_producer()

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
template<typename It >
size_t moodycamel::ConcurrentQueue< T, Traits >::try_dequeue_bulk_from_producer ( producer_token_t const &  producer,
It  itemFirst,
size_t  max 
)
inline

Definition at line 1241 of file ConcurrentQueue.h.

◆ try_dequeue_from_producer()

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
template<typename U >
bool moodycamel::ConcurrentQueue< T, Traits >::try_dequeue_from_producer ( producer_token_t const &  producer,
U &  item 
)
inline

Definition at line 1228 of file ConcurrentQueue.h.

◆ try_dequeue_non_interleaved()

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
template<typename U >
bool moodycamel::ConcurrentQueue< T, Traits >::try_dequeue_non_interleaved ( U &  item)
inline

Definition at line 1096 of file ConcurrentQueue.h.

◆ try_enqueue() [1/4]

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
bool moodycamel::ConcurrentQueue< T, Traits >::try_enqueue ( T const &  item)
inline

Definition at line 988 of file ConcurrentQueue.h.

◆ try_enqueue() [2/4]

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
bool moodycamel::ConcurrentQueue< T, Traits >::try_enqueue ( T &&  item)
inline

Definition at line 999 of file ConcurrentQueue.h.

◆ try_enqueue() [3/4]

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
bool moodycamel::ConcurrentQueue< T, Traits >::try_enqueue ( producer_token_t const &  token,
T const &  item 
)
inline

Definition at line 1008 of file ConcurrentQueue.h.

◆ try_enqueue() [4/4]

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
bool moodycamel::ConcurrentQueue< T, Traits >::try_enqueue ( producer_token_t const &  token,
T &&  item 
)
inline

Definition at line 1016 of file ConcurrentQueue.h.

◆ try_enqueue_bulk() [1/2]

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
template<typename It >
bool moodycamel::ConcurrentQueue< T, Traits >::try_enqueue_bulk ( It  itemFirst,
size_t  count 
)
inline

Definition at line 1029 of file ConcurrentQueue.h.

◆ try_enqueue_bulk() [2/2]

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
template<typename It >
bool moodycamel::ConcurrentQueue< T, Traits >::try_enqueue_bulk ( producer_token_t const &  token,
It  itemFirst,
size_t  count 
)
inline

Definition at line 1041 of file ConcurrentQueue.h.

◆ try_get_block_from_free_list()

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
Block* moodycamel::ConcurrentQueue< T, Traits >::try_get_block_from_free_list ( )
inlineprivate

Definition at line 3006 of file ConcurrentQueue.h.

◆ try_get_block_from_initial_pool()

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
Block* moodycamel::ConcurrentQueue< T, Traits >::try_get_block_from_initial_pool ( )
inlineprivate

Definition at line 2978 of file ConcurrentQueue.h.

◆ update_current_producer_after_rotation()

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
bool moodycamel::ConcurrentQueue< T, Traits >::update_current_producer_after_rotation ( consumer_token_t token)
inlineprivate

Definition at line 1320 of file ConcurrentQueue.h.

Friends And Related Function Documentation

◆ ConcurrentQueueTests

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
friend class ConcurrentQueueTests
friend

Definition at line 1285 of file ConcurrentQueue.h.

◆ ConsumerToken

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
friend struct ConsumerToken
friend

Definition at line 1280 of file ConcurrentQueue.h.

◆ ExplicitProducer

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
friend struct ExplicitProducer
friend

Definition at line 1281 of file ConcurrentQueue.h.

◆ ImplicitProducer

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
friend struct ImplicitProducer
friend

Definition at line 1283 of file ConcurrentQueue.h.

◆ moodycamel::swap

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
template<typename XT , typename XTraits >
void moodycamel::swap ( typename ConcurrentQueue< XT, XTraits >::ImplicitProducerKVP ,
typename ConcurrentQueue< XT, XTraits >::ImplicitProducerKVP  
)
friend

◆ ProducerToken

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
friend struct ProducerToken
friend

Definition at line 1279 of file ConcurrentQueue.h.

Member Data Documentation

◆ BLOCK_SIZE

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
const size_t moodycamel::ConcurrentQueue< T, Traits >::BLOCK_SIZE = static_cast<size_t>(Traits::BLOCK_SIZE)
static

Definition at line 704 of file ConcurrentQueue.h.

◆ EXPLICIT_BLOCK_EMPTY_COUNTER_THRESHOLD

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
const size_t moodycamel::ConcurrentQueue< T, Traits >::EXPLICIT_BLOCK_EMPTY_COUNTER_THRESHOLD = static_cast<size_t>(Traits::EXPLICIT_BLOCK_EMPTY_COUNTER_THRESHOLD)
static

Definition at line 705 of file ConcurrentQueue.h.

◆ EXPLICIT_CONSUMER_CONSUMPTION_QUOTA_BEFORE_ROTATE

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
const std::uint32_t moodycamel::ConcurrentQueue< T, Traits >::EXPLICIT_CONSUMER_CONSUMPTION_QUOTA_BEFORE_ROTATE = static_cast<std::uint32_t>(Traits::EXPLICIT_CONSUMER_CONSUMPTION_QUOTA_BEFORE_ROTATE)
static

Definition at line 709 of file ConcurrentQueue.h.

◆ EXPLICIT_INITIAL_INDEX_SIZE

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
const size_t moodycamel::ConcurrentQueue< T, Traits >::EXPLICIT_INITIAL_INDEX_SIZE = static_cast<size_t>(Traits::EXPLICIT_INITIAL_INDEX_SIZE)
static

Definition at line 706 of file ConcurrentQueue.h.

◆ freeList

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
FreeList<Block> moodycamel::ConcurrentQueue< T, Traits >::freeList
private

◆ globalExplicitConsumerOffset

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
std::atomic<std::uint32_t> moodycamel::ConcurrentQueue< T, Traits >::globalExplicitConsumerOffset
private

◆ IMPLICIT_INITIAL_INDEX_SIZE

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
const size_t moodycamel::ConcurrentQueue< T, Traits >::IMPLICIT_INITIAL_INDEX_SIZE = static_cast<size_t>(Traits::IMPLICIT_INITIAL_INDEX_SIZE)
static

Definition at line 707 of file ConcurrentQueue.h.

◆ implicitProducerHash

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
std::atomic<ImplicitProducerHash*> moodycamel::ConcurrentQueue< T, Traits >::implicitProducerHash
private

◆ implicitProducerHashCount

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
std::atomic<size_t> moodycamel::ConcurrentQueue< T, Traits >::implicitProducerHashCount
private

◆ implicitProducerHashResizeInProgress

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
std::atomic_flag moodycamel::ConcurrentQueue< T, Traits >::implicitProducerHashResizeInProgress
private

Definition at line 3571 of file ConcurrentQueue.h.

◆ INITIAL_IMPLICIT_PRODUCER_HASH_SIZE

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
const size_t moodycamel::ConcurrentQueue< T, Traits >::INITIAL_IMPLICIT_PRODUCER_HASH_SIZE = static_cast<size_t>(Traits::INITIAL_IMPLICIT_PRODUCER_HASH_SIZE)
static

Definition at line 708 of file ConcurrentQueue.h.

◆ initialBlockPool

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
Block* moodycamel::ConcurrentQueue< T, Traits >::initialBlockPool
private

◆ initialBlockPoolIndex

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
std::atomic<size_t> moodycamel::ConcurrentQueue< T, Traits >::initialBlockPoolIndex
private

◆ initialBlockPoolSize

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
size_t moodycamel::ConcurrentQueue< T, Traits >::initialBlockPoolSize
private

◆ initialImplicitProducerHash

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
ImplicitProducerHash moodycamel::ConcurrentQueue< T, Traits >::initialImplicitProducerHash
private

◆ initialImplicitProducerHashEntries

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
std::array<ImplicitProducerKVP, INITIAL_IMPLICIT_PRODUCER_HASH_SIZE> moodycamel::ConcurrentQueue< T, Traits >::initialImplicitProducerHashEntries
private

◆ MAX_SUBQUEUE_SIZE

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
const size_t moodycamel::ConcurrentQueue< T, Traits >::MAX_SUBQUEUE_SIZE = (details::const_numeric_max<size_t>::value - static_cast<size_t>(Traits::MAX_SUBQUEUE_SIZE) < BLOCK_SIZE) ? details::const_numeric_max<size_t>::value : ((static_cast<size_t>(Traits::MAX_SUBQUEUE_SIZE) + (BLOCK_SIZE - 1)) / BLOCK_SIZE * BLOCK_SIZE)
static

Definition at line 715 of file ConcurrentQueue.h.

◆ nextExplicitConsumerId

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
std::atomic<std::uint32_t> moodycamel::ConcurrentQueue< T, Traits >::nextExplicitConsumerId
private

◆ producerCount

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
std::atomic<std::uint32_t> moodycamel::ConcurrentQueue< T, Traits >::producerCount
private

◆ producerListTail

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
std::atomic<ProducerBase*> moodycamel::ConcurrentQueue< T, Traits >::producerListTail
private

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