SC_Rwlock implementation, SC_Lwcond draft

Other small changes
This commit is contained in:
Nekotekina 2014-01-30 00:31:09 +04:00
parent 4de64e5afe
commit 67a144df2a
11 changed files with 451 additions and 34 deletions

View file

@ -15,7 +15,7 @@ struct SpuGroupInfo
{
CPUThread* threads[g_spu_group_thr_count];
sys_spu_thread_group_attribute& attr;
volatile long lock;
std::atomic<u32> lock;
SpuGroupInfo(sys_spu_thread_group_attribute& attr) : attr(attr), lock(0)
{
@ -259,7 +259,7 @@ int sys_spu_thread_group_join(u32 id, mem32_t cause, mem32_t status)
return CELL_ESRCH;
}
if (_InterlockedCompareExchange(&group_info->lock, 1, 0)) //get lock
if (group_info->lock.exchange(1)) //get lock
{
return CELL_EBUSY;
}
@ -275,7 +275,7 @@ int sys_spu_thread_group_join(u32 id, mem32_t cause, mem32_t status)
}
}
_InterlockedExchange(&group_info->lock, 0); //release lock
group_info->lock = 0; //release lock
return CELL_OK;
}