|
Twitch SDK (Internal)
|
#include <concurrentqueue.h>
Public Member Functions | |
| ConcurrentQueue () | |
| void | clear () |
| bool | empty () const |
| void | push (const TYPE &item) |
| void | push (TYPE &&item) |
| bool | try_pop (TYPE &result) |
| size_t | unsafe_size () const |
Private Attributes | |
| std::queue< TYPE > | mQueue |
| std::shared_ptr< IMutex > | mMutex |
An implementation of a queue which allows concurrent pushes and pops.
|
inline |
|
inline |
|
inline |
|
inline |
Pushes the item onto the back of the queue in a thread-safe manner.
|
inline |
Pushes the item onto the back of the queue in a thread-safe manner.
|
inline |
Attempts to pop from the front of the queue in a thread-safe manner. If an item is available then the result will be set to the value and true will be returned. Otherwise, false will be returned.
NOTE: Be careful if ITEM doesn't support move assignment since it may call the assignment operator and destructor of the value while under the lock. If this is the case, be sure that the assignment operator and destructor will not in turn call back into the ConcurrentQueue instance or a deadlock may occur.
|
inline |
Retrieves the size of the queue. This is not thread safe so use it only to determine the approximate size of the queue.
|
private |
|
private |
1.8.13