mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-10 17:01:24 +12:00
Cleanup semaphore<> (sema.h) and mutex.h (shared_mutex)
Remove semaphore_lock and writer_lock classes, replace with std::lock_guard Change semaphore<> interface to Lockable (+ exotic try_unlock method)
This commit is contained in:
parent
5e556a87ff
commit
ca5158a03e
50 changed files with 283 additions and 382 deletions
|
@ -116,7 +116,7 @@ error_code sys_mutex_lock(ppu_thread& ppu, u32 mutex_id, u64 timeout)
|
|||
|
||||
if (result == CELL_EBUSY)
|
||||
{
|
||||
semaphore_lock lock(mutex.mutex);
|
||||
std::lock_guard lock(mutex.mutex);
|
||||
|
||||
if (mutex.try_own(ppu, ppu.id))
|
||||
{
|
||||
|
@ -158,7 +158,7 @@ error_code sys_mutex_lock(ppu_thread& ppu, u32 mutex_id, u64 timeout)
|
|||
|
||||
if (passed >= timeout)
|
||||
{
|
||||
semaphore_lock lock(mutex->mutex);
|
||||
std::lock_guard lock(mutex->mutex);
|
||||
|
||||
if (!mutex->unqueue(mutex->sq, &ppu))
|
||||
{
|
||||
|
@ -224,7 +224,7 @@ error_code sys_mutex_unlock(ppu_thread& ppu, u32 mutex_id)
|
|||
|
||||
if (mutex.ret == CELL_EBUSY)
|
||||
{
|
||||
semaphore_lock lock(mutex->mutex);
|
||||
std::lock_guard lock(mutex->mutex);
|
||||
|
||||
if (auto cpu = mutex->reown<ppu_thread>())
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue