rsx/overlays: Use lf_queue for a lock-free stack implementation

This commit is contained in:
kd-11 2023-02-14 02:27:47 +03:00 committed by kd-11
parent 388ca1c645
commit 7db6594358
4 changed files with 34 additions and 50 deletions

View file

@ -359,6 +359,14 @@ public:
return result;
}
// Withdraw the list in reverse order (LIFO/FILO)
lf_queue_slice<T> pop_all_reversed()
{
lf_queue_slice<T> result;
result.m_head = m_head.exchange(nullptr);
return result;
}
// Apply func(data) to each element, return the total length
template <typename F>
usz apply(F func)