Get rid of the PrioritizedWorkQueue. Instead just queue tasks on the ThreadManager.

This commit is contained in:
Henrik Rydgård committed 2021-06-12 13:03:53 +02:00
1 parent 34f8fc557f
commit 446c2c027e
17 files changed
+102 -293

No files matched your search

+2 -7
View File
@@ -8,7 +8,7 @@
#include "Common/Thread/ThreadManager.h"
// Kind of like a semaphore I guess.
struct WaitableCounter {
struct WaitableCounter : public Waitable {
public:
WaitableCounter(int maxValue) : maxValue_(maxValue) {}
@@ -19,18 +19,13 @@ public:
}
}
void Wait() {
void Wait() override {
std::unique_lock<std::mutex> lock(mutex_);
while (count_.load() != maxValue_) {
cond_.wait(lock);
}
}
void WaitAndRelease() {
Wait();
delete this;
}
int maxValue_;
std::atomic<int> count_;
std::mutex mutex_;