mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-12 22:57:57 -05:00
svc: Implement yield types 0 and -1
This commit is contained in:
@ -6,6 +6,7 @@
|
||||
|
||||
#include <array>
|
||||
#include <deque>
|
||||
#include <functional>
|
||||
#include <boost/range/algorithm_ext/erase.hpp>
|
||||
|
||||
namespace Common {
|
||||
@ -49,6 +50,21 @@ struct ThreadQueueList {
|
||||
return T();
|
||||
}
|
||||
|
||||
T get_first_filter(std::function<bool(T)> filter) const {
|
||||
const Queue* cur = first;
|
||||
while (cur != nullptr) {
|
||||
if (!cur->data.empty()) {
|
||||
for (const auto& item : cur->data) {
|
||||
if (filter(item))
|
||||
return item;
|
||||
}
|
||||
}
|
||||
cur = cur->next_nonempty;
|
||||
}
|
||||
|
||||
return T();
|
||||
}
|
||||
|
||||
T pop_first() {
|
||||
Queue* cur = first;
|
||||
while (cur != nullptr) {
|
||||
|
Reference in New Issue
Block a user