mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-05 22:47:03 +00:00
atomic.hpp: add some features and optimizations
Add atomic_t<>::observe() (relaxed load) Add atomic_fence_XXX() (barrier functions) Get rid of MFENCE instruction, replace with no-op LOCK OR on stack. Remove <atomic> dependence from stdafx.h and relevant headers.
This commit is contained in:
parent
77aa9e58f2
commit
b16cc618b5
14 changed files with 171 additions and 60 deletions
|
|
@ -128,7 +128,7 @@ error_code sys_lwmutex_lock(ppu_thread& ppu, vm::ptr<sys_lwmutex_t> lwmutex, u64
|
|||
|
||||
// recursive locking succeeded
|
||||
lwmutex->recursive_count++;
|
||||
std::atomic_thread_fence(std::memory_order_acq_rel);
|
||||
atomic_fence_acq_rel();
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
@ -288,7 +288,7 @@ error_code sys_lwmutex_trylock(ppu_thread& ppu, vm::ptr<sys_lwmutex_t> lwmutex)
|
|||
|
||||
// recursive locking succeeded
|
||||
lwmutex->recursive_count++;
|
||||
std::atomic_thread_fence(std::memory_order_acq_rel);
|
||||
atomic_fence_acq_rel();
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue