mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-28 13:28:01 +03:00
SPU: Cache reservation memory direct access handle (optimization)
This commit is contained in:
parent
1458349cb3
commit
3dda72e47f
2 changed files with 64 additions and 31 deletions
|
@ -276,8 +276,8 @@ public:
|
|||
}
|
||||
|
||||
// Wait for both thread sync var and provided atomic var
|
||||
template <atomic_wait::op Op = atomic_wait::op::eq, typename T, typename U>
|
||||
static inline void wait_on(T& wait, U old, u64 usec = -1)
|
||||
template <uint Max, typename Func>
|
||||
static inline void wait_on_custom(Func&& setter, u64 usec = -1)
|
||||
{
|
||||
auto _this = g_tls_this_thread;
|
||||
|
||||
|
@ -286,13 +286,19 @@ public:
|
|||
return;
|
||||
}
|
||||
|
||||
atomic_wait::list<3> list{};
|
||||
list.set<0, Op>(wait, old);
|
||||
list.set<1>(_this->m_sync, 0, 4 + 1);
|
||||
list.set<2>(_this->m_taskq, nullptr);
|
||||
atomic_wait::list<Max + 2> list{};
|
||||
list.template set<Max>(_this->m_sync, 0, 4 + 1);
|
||||
list.template set<Max + 1>(_this->m_taskq, nullptr);
|
||||
setter(list);
|
||||
list.wait(atomic_wait_timeout{usec <= 0xffff'ffff'ffff'ffff / 1000 ? usec * 1000 : 0xffff'ffff'ffff'ffff});
|
||||
}
|
||||
|
||||
template <atomic_wait::op Op = atomic_wait::op::eq, typename T, typename U>
|
||||
static inline void wait_on(T& wait, U old, u64 usec = -1)
|
||||
{
|
||||
wait_on_custom<1>([&](atomic_wait::list<3>& list){ list.set<0, Op>(wait, old); }, usec);
|
||||
}
|
||||
|
||||
// Exit.
|
||||
[[noreturn]] static void emergency_exit(std::string_view reason);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue