18 lines
282 B
C++
18 lines
282 B
C++
// Shared_Queue.hh
|
|
#include <condition_variable>
|
|
#include <mutex>
|
|
#include <queue>
|
|
|
|
#ifndef SHARED_QUEUE_HH
|
|
#define SHARED_QUEUE_HH
|
|
template <class T>
|
|
class SharedQueue
|
|
{
|
|
// Queue
|
|
std::queue<T> queue;
|
|
|
|
// Synchronisation
|
|
std::mutex mutex;
|
|
std::condition_variable cv;
|
|
};
|
|
#endif
|