Switching to linux for development of pglab.
Switched from qmake to cmake. Code changes to make it compile.
This commit is contained in:
parent
dd9906dbd8
commit
04723a289b
142 changed files with 124 additions and 83 deletions
|
|
@ -1,34 +0,0 @@
|
|||
#include "tsqueue.h"
|
||||
|
||||
TSQueue::TSQueue()
|
||||
: newData(Win32Event::Reset::Manual, Win32Event::Initial::Clear)
|
||||
{}
|
||||
|
||||
void TSQueue::add(t_Callable callable)
|
||||
{
|
||||
std::lock_guard<std::mutex> g(m);
|
||||
futureQueue.push_back(std::move(callable));
|
||||
newData.set();
|
||||
}
|
||||
|
||||
bool TSQueue::empty()
|
||||
{
|
||||
std::lock_guard<std::mutex> g(m);
|
||||
return futureQueue.empty();
|
||||
}
|
||||
|
||||
TSQueue::t_Callable TSQueue::pop()
|
||||
{
|
||||
std::lock_guard<std::mutex> g(m);
|
||||
auto f = std::move(futureQueue.front());
|
||||
futureQueue.pop_front();
|
||||
if (futureQueue.empty()) {
|
||||
newData.reset();
|
||||
}
|
||||
return f;
|
||||
}
|
||||
|
||||
HANDLE TSQueue::getNewDataEventHandle()
|
||||
{
|
||||
return newData.handle();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue