mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-04 14:08:37 +00:00
Improve vm::reservation_op
Remove XABORT, sync status handling with SPU/PPU transaction. Limit max number of transaction attempts in loop. Add Ack template parameter, as in vm::reservation_light_op. Remove utils::tx_abort, improve utils::tx_start as well.
This commit is contained in:
parent
dc8252bb9f
commit
4384ae15b4
3 changed files with 55 additions and 80 deletions
|
|
@ -509,25 +509,18 @@ namespace vm
|
|||
|
||||
void reservation_op_internal(u32 addr, std::function<bool()> func)
|
||||
{
|
||||
const bool ok = cpu_thread::suspend_all(get_current_cpu_thread(), [&]
|
||||
cpu_thread::suspend_all(get_current_cpu_thread(), [&]
|
||||
{
|
||||
if (func())
|
||||
{
|
||||
// Success, release all locks if necessary
|
||||
vm::reservation_acquire(addr, 128) += 127;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
vm::reservation_acquire(addr, 128) -= 1;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
if (ok)
|
||||
{
|
||||
vm::reservation_notifier(addr, 128).notify_all();
|
||||
}
|
||||
}
|
||||
|
||||
void reservation_escape_internal()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue