mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-08 16:01:42 +12:00
Implement class cond_x16
Use as reservation notifier Limited to 16 threads but allows more precise control of contention
This commit is contained in:
parent
7f1cbb1136
commit
febe4d4a10
4 changed files with 243 additions and 8 deletions
|
@ -22,7 +22,6 @@
|
|||
#include <cfenv>
|
||||
#include <atomic>
|
||||
#include <thread>
|
||||
#include <shared_mutex>
|
||||
|
||||
const bool s_use_ssse3 =
|
||||
#ifdef _MSC_VER
|
||||
|
@ -1710,9 +1709,7 @@ s64 spu_thread::get_ch_value(u32 ch)
|
|||
fmt::throw_exception("Not supported: event mask 0x%x" HERE, mask1);
|
||||
}
|
||||
|
||||
std::shared_lock pseudo_lock(vm::reservation_notifier(raddr, 128), std::try_to_lock);
|
||||
|
||||
verify(HERE), pseudo_lock;
|
||||
const auto pseudo_lock = vm::reservation_notifier(raddr, 128).lock_one();
|
||||
|
||||
while (res = get_events(), !res)
|
||||
{
|
||||
|
@ -1721,7 +1718,7 @@ s64 spu_thread::get_ch_value(u32 ch)
|
|||
return -1;
|
||||
}
|
||||
|
||||
pseudo_lock.mutex()->wait(100);
|
||||
pseudo_lock.wait(100);
|
||||
}
|
||||
|
||||
return res;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue