mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-10 00:41:26 +12:00
CellSpurs initialization
This commit is contained in:
parent
df84e89d46
commit
bb77249ac8
22 changed files with 599 additions and 272 deletions
|
@ -25,7 +25,8 @@ template
|
|||
class SMutexBase
|
||||
{
|
||||
static_assert(sizeof(T) == sizeof(std::atomic<T>), "Invalid SMutexBase type");
|
||||
std::atomic<T> owner;
|
||||
T owner;
|
||||
typedef std::atomic<T> AT;
|
||||
|
||||
public:
|
||||
static const T GetFreeValue()
|
||||
|
@ -45,10 +46,10 @@ public:
|
|||
owner = GetFreeValue();
|
||||
}
|
||||
|
||||
SMutexBase()
|
||||
{
|
||||
initialize();
|
||||
}
|
||||
//SMutexBase()
|
||||
//{
|
||||
// initialize();
|
||||
//}
|
||||
|
||||
void finalize()
|
||||
{
|
||||
|
@ -68,7 +69,7 @@ public:
|
|||
}
|
||||
T old = GetFreeValue();
|
||||
|
||||
if (!owner.compare_exchange_strong(old, tid))
|
||||
if (!reinterpret_cast<AT&>(owner).compare_exchange_strong(old, tid))
|
||||
{
|
||||
if (old == tid)
|
||||
{
|
||||
|
@ -92,7 +93,7 @@ public:
|
|||
}
|
||||
T old = tid;
|
||||
|
||||
if (!owner.compare_exchange_strong(old, to))
|
||||
if (!reinterpret_cast<AT&>(owner).compare_exchange_strong(old, to))
|
||||
{
|
||||
if (old == GetFreeValue())
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue