Re: OSSpinLockInit in OSX
Nathan Sims <[email protected]> Fri, 6 May 2011 10:47:04 -0700
| Newsgroups | gmane.comp.macosx.devel |
|---|---|
| Message-ID | <[email protected]> |
Thanks! I hadn't seen that. By the way, are the OSSpinLock* functions preferred over pthread_spin_* functions? -Nate On May 6, 2011, at 10:40 AM, Shantonu Sen wrote: > See the header file: > > /*! @abstract The default value for an <code>OSSpinLock</code>. > @discussion > The convention is that unlocked is zero, locked is nonzero. > */ > #define OS_SPINLOCK_INIT 0 > > Shantonu Sen > [email protected] > > > > On May 6, 2011, at 10:36 AM, Nathan Sims wrote: > >> I'm porting some C code from Linux which uses OSSpinLock function calls. >> OSX has the same functions (declated in OSAtomic.h): >> • OSSpinLockLock() >> • OSSpinLockTry() >> • OSSpinLockUnlock() >> >> However, OSX is missing this function: >> >> • OSSpinLockInit() >> >> Is there no initialization needed for an OSSpinLock? >> >> _______________________________________________ >> MacOSX-dev mailing list >> [email protected] >> http://www.omnigroup.com/mailman/listinfo/macosx-dev >