A concurrent queue guarded by a spinlock and can be accessed by multi-producers and multi-consumers simultaneously.
More...
#include <concurrent_queue.h>
|
void | Put (const T &item) |
| Put an entity into this queue. More...
|
|
void | Put (T &&item) |
| Put an entity into this queue. More...
|
|
bool | Get (T &item) |
| Get an entity from this queue. More...
|
|
void | Clear () |
|
template<typename T>
class grape::NonblockingQueue< T >
A concurrent queue guarded by a spinlock and can be accessed by multi-producers and multi-consumers simultaneously.
- Template Parameters
-
T | Type of entities in the queue. |
◆ Get()
Get an entity from this queue.
This function won't be blocked.
- Parameters
-
item | Reference of an entity to hold the got data. |
- Returns
- If got data, return true. Otherwise, return false.
◆ Put() [1/2]
Put an entity into this queue.
This function won't be blocked.
- Parameters
-
item | The entity to be put. |
◆ Put() [2/2]
Put an entity into this queue.
This function won't be blocked.
- Parameters
-
item | The entity to be put. |