Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
platform
Concurrency
MPMCQueue.h
1
// Copyright eeGeo Ltd (2012-2022), All Rights Reserved
2
3
#pragma once
4
5
#include "Types.h"
6
#include "SemaphoreEegeo.h"
7
#include <pthread.h>
8
#include <queue>
9
#include <list>
10
11
namespace
Eegeo
12
{
13
namespace
Concurrency
14
{
15
template
<
typename
T>
16
class
MPMCQueue
:
protected
Eegeo::NonCopyable
17
{
18
public
:
19
MPMCQueue
();
20
~
MPMCQueue
();
21
22
size_t
Size()
const
;
23
void
Enqueue(T message);
24
void
EnqueueHead(T message);
25
T Dequeue();
26
bool
TryDequeue(T& message);
27
private
:
28
T DequeueMessageFromHead();
29
std::list<T> m_queue;
30
mutable
pthread_mutex_t m_mutex;
31
Semaphore
m_signal;
32
};
33
34
}
35
}
36
37
#include "MPMCQueueImpl.h"
38
39
Generated on Sat Jun 10 2023 02:00:29 for eeGeo Platform SDK by
1.8.3.1