mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-28 13:28:01 +03:00
Fix freezes in HLE Vdec and SPU LLVM precompilation.
Freezes could accidentally occur on close or ingame. Deprecate range-for loop on lf_queue. This is a part of PR #9208 Co-authored-by: Eladash <elad3356p@gmail.com>
This commit is contained in:
parent
0c034ad7de
commit
d0126f0fa0
3 changed files with 41 additions and 61 deletions
|
@ -365,64 +365,6 @@ public:
|
|||
|
||||
return count;
|
||||
}
|
||||
|
||||
// Iterator that enables direct endless range-for loop: for (auto* ptr : queue) ...
|
||||
class iterator
|
||||
{
|
||||
lf_queue* _this = nullptr;
|
||||
|
||||
lf_queue_slice<T> m_data;
|
||||
|
||||
public:
|
||||
constexpr iterator() = default;
|
||||
|
||||
explicit iterator(lf_queue* _this)
|
||||
: _this(_this)
|
||||
{
|
||||
m_data = _this->pop_all();
|
||||
}
|
||||
|
||||
bool operator !=(const iterator& rhs) const
|
||||
{
|
||||
return _this != rhs._this;
|
||||
}
|
||||
|
||||
T* operator *() const
|
||||
{
|
||||
return m_data ? m_data.get() : nullptr;
|
||||
}
|
||||
|
||||
iterator& operator ++()
|
||||
{
|
||||
if (m_data)
|
||||
{
|
||||
m_data.pop_front();
|
||||
}
|
||||
|
||||
if (!m_data)
|
||||
{
|
||||
m_data = _this->pop_all();
|
||||
|
||||
if (!m_data)
|
||||
{
|
||||
_this->wait();
|
||||
m_data = _this->pop_all();
|
||||
}
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
iterator begin()
|
||||
{
|
||||
return iterator{this};
|
||||
}
|
||||
|
||||
iterator end()
|
||||
{
|
||||
return iterator{};
|
||||
}
|
||||
};
|
||||
|
||||
// Concurrent linked list, elements remain until destroyed.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue