mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-03 13:01:55 +01:00
Add queue flush ability. Fix VGrid wrapping in UI. Fix some strange java error.
This commit is contained in:
1 parent
961e400e1f
commit
345180dcef
4 files changed
+15
-3
No files matched your search
@@ -31,6 +31,18 @@ void PrioritizedWorkQueue::Stop() {
|
||||
mutex_.unlock();
|
||||
}
|
||||
|
||||
void PrioritizedWorkQueue::Flush() {
|
||||
if (queue_.empty())
|
||||
return;
|
||||
mutex_.lock();
|
||||
for (auto iter = queue_.begin(); iter != queue_.end(); ++iter) {
|
||||
delete *iter;
|
||||
}
|
||||
queue_.clear();
|
||||
mutex_.unlock();
|
||||
}
|
||||
|
||||
|
||||
// The worker should simply call this in a loop. Will block when appropriate.
|
||||
PrioritizedWorkQueueItem *PrioritizedWorkQueue::Pop() {
|
||||
mutex_.lock();
|
||||
@@ -67,6 +79,7 @@ static void threadfunc(PrioritizedWorkQueue *wq) {
|
||||
break;
|
||||
} else {
|
||||
item->run();
|
||||
delete item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user