early-access version 1561

This commit is contained in:
pineappleEA
2021-04-07 20:28:12 +02:00
parent db63269e15
commit 0f685141d2
8 changed files with 69 additions and 34 deletions

View File

@@ -83,11 +83,15 @@ public:
return true;
}
T PopWait() {
void Wait() {
if (Empty()) {
std::unique_lock lock{cv_mutex};
cv.wait(lock, [this]() { return !Empty(); });
}
}
T PopWait() {
Wait();
T t;
Pop(t);
return t;
@@ -156,6 +160,10 @@ public:
return spsc_queue.Pop(t);
}
void Wait() {
spsc_queue.Wait();
}
T PopWait() {
return spsc_queue.PopWait();
}