Locks
Locks
- Subject: Locks
- From: koko <email@hidden>
- Date: Tue, 06 Dec 2011 16:28:57 -0700
In windows we have:
LONG volatile Mylock = 0;
InterlockedIncrement(&Mylock);
InterlockedDecrement(&Mylock);
What should these be replaced with for OSX as in :
#ifndef MAC
LONG volatile Mylock = 0;
#else
// Mac
#endif
void SetLock()
{
// EnterCriticalSection(&m_cs);
#ifndef MAC
while(Mylock){Sleep(0);}; // Give up timeslice
InterlockedIncrement(&Mylock);
#else
// Mac
#endif
}
void FreeLock()
{
// LeaveCriticalSection(&m_cs);
#ifndef MAC
InterlockedDecrement(&Mylock);
#else
// Mac
#endif
}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden