Revert "Remove shared_cond and simplify reservation waiting"

This reverts commit 0a96497e13.
This commit is contained in:
Nekotekina 2019-09-13 23:54:43 +03:00
parent c9170bbb88
commit b70c08a2e8
7 changed files with 349 additions and 3 deletions

View file

@ -2385,6 +2385,13 @@ s64 spu_thread::get_ch_value(u32 ch)
fmt::throw_exception("Not supported: event mask 0x%x" HERE, mask1);
}
const auto pseudo_lock = vm::reservation_notifier(raddr, 128).try_shared_lock();
if (!pseudo_lock)
{
fmt::throw_exception("Unexpected: reservation notifier lock failed");
}
while (res = get_events(), !res)
{
state += cpu_flag::wait;
@ -2394,7 +2401,7 @@ s64 spu_thread::get_ch_value(u32 ch)
return -1;
}
vm::reservation_notifier(raddr, 128).wait<UINT64_MAX & -128>(rtime, atomic_wait_timeout{30000});
pseudo_lock.wait(100);
}
check_state();