fixes to compile/share more code between SPU and PPU

This commit is contained in:
ejcoumans 2008-02-01 03:44:17 +00:00
parent 5399a9ae8c
commit 984811f459

View File

@ -75,31 +75,37 @@ public:
btSpinlock (SpinVariable* var)
: spinVariable (var)
{}
#ifndef __SPU__
void Init ()
{
#ifndef __SPU__
//*spinVariable = 1;
cellSyncMutexInitialize(spinVariable);
}
#endif
}
#ifdef __SPU__
void Lock ()
{
#ifdef __SPU__
// lock semaphore
/*while (cellAtomicTestAndDecr32(atomic_buf, (uint64_t)spinVariable) == 0)
{
};*/
cellSyncMutexLock((uint64_t)spinVariable);
#endif
}
void Unlock ()
{
#ifdef __SPU__
//cellAtomicIncr32(atomic_buf, (uint64_t)spinVariable);
cellSyncMutexUnlock((uint64_t)spinVariable);
#endif
}
#endif
private:
SpinVariable* spinVariable;