Implement class cond_x16

Use as reservation notifier
Limited to 16 threads but allows more precise control of contention
This commit is contained in:
Nekotekina 2018-11-25 19:43:02 +03:00
parent 7f1cbb1136
commit febe4d4a10
4 changed files with 243 additions and 8 deletions

View file

@ -7,7 +7,7 @@
class shared_mutex;
class cpu_thread;
class notifier;
class cond_x16;
namespace vm
{
@ -105,9 +105,9 @@ namespace vm
}
// Get reservation sync variable
inline notifier& reservation_notifier(u32 addr, u32 size)
inline cond_x16& reservation_notifier(u32 addr, u32 size)
{
return *reinterpret_cast<notifier*>(g_reservations2 + addr / 128 * 8);
return *reinterpret_cast<cond_x16*>(g_reservations2 + addr / 128 * 8);
}
void reservation_lock_internal(atomic_t<u64>&);