mirror of
https://github.com/libretro/ppsspp.git
synced 2025-02-10 19:12:12 +00:00
Oops, forgot this
This commit is contained in:
parent
50d66f9a19
commit
01b9400223
@ -32,6 +32,23 @@ void PrioritizedWorkQueue::Flush() {
|
||||
queue_.clear();
|
||||
}
|
||||
|
||||
void PrioritizedWorkQueue::WaitUntilDone() {
|
||||
if (queue_.empty())
|
||||
return;
|
||||
// This could be made more elegant..
|
||||
while (true) {
|
||||
bool empty;
|
||||
{
|
||||
lock_guard guard(mutex_);
|
||||
empty = queue_.empty();
|
||||
}
|
||||
if (empty) {
|
||||
break;
|
||||
}
|
||||
sleep_ms(10);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// The worker should simply call this in a loop. Will block when appropriate.
|
||||
PrioritizedWorkQueueItem *PrioritizedWorkQueue::Pop() {
|
||||
|
@ -34,6 +34,7 @@ public:
|
||||
void Flush();
|
||||
bool Done() { return done_; }
|
||||
void Stop();
|
||||
void WaitUntilDone();
|
||||
|
||||
private:
|
||||
bool done_;
|
||||
|
Loading…
x
Reference in New Issue
Block a user