mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-10 21:16:24 +02:00
Get rid of the PrioritizedWorkQueue. Instead just queue tasks on the ThreadManager.
This commit is contained in:
1 parent
34f8fc557f
commit
446c2c027e
17 files changed
+102
-293
No files matched your search
@@ -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_;
|
||||
|
||||
Reference in new issue
Block a user