SPU: fix possible livelock

The bug affects TSX path
This commit is contained in:
Nekotekina 2018-04-07 02:16:32 +03:00
parent 3681507136
commit 0797164fac
4 changed files with 33 additions and 19 deletions

View file

@ -39,11 +39,11 @@ namespace utils
bool has_xop();
inline bool transaction_enter()
FORCE_INLINE bool transaction_enter(uint* out = nullptr)
{
while (true)
{
const auto status = _xbegin();
const uint status = _xbegin();
if (status == _XBEGIN_STARTED)
{
@ -52,6 +52,11 @@ namespace utils
if (!(status & _XABORT_RETRY))
{
if (out)
{
*out = status;
}
return false;
}
}