Re: IOLocks deprecated ???
Re: IOLocks deprecated ???
- Subject: Re: IOLocks deprecated ???
- From: Shawn Erickson <email@hidden>
- Date: Tue, 4 Dec 2001 08:18:39 -0800
On Tuesday, December 4, 2001, at 04:58 AM, Francis Bouchard wrote:
In IOLocks.h I can see this:
#ifndef IOKIT_DEPRECATED
#define IOKIT_DEPRECATED 1
#endif
Does that means I shouldn't use it ?
Yes... but it applies only to the stuff wrapped with IOKIT_DEPRECATED.
Look around in the IOLocks.h header.
Only the following are deprecated, everything else you should be able to
use (IOSyncer and others heavily utilize the stuff defined in IOLocks).
#if IOKIT_DEPRECATED
/* The following API is deprecated */
typedef enum {
kIOLockStateUnlocked = 0,
kIOLockStateLocked = 1,
} IOLockState;
void IOLockInitWithState( IOLock * lock, IOLockState state);
#define IOLockInit( l ) IOLockInitWithState( l, kIOLockStateUnlocked);
static __inline__ void IOTakeLock( IOLock * lock) { IOLockLock(lock);
}
static __inline__ boolean_t IOTryLock( IOLock * lock)
{ return(IOLockTryLock(lock)); }
static __inline__ void IOUnlock( IOLock * lock) { IOLockUnlock(lock);
}
#endif /* IOKIT_DEPRECATED */
#if IOKIT_DEPRECATED
/* The following API is deprecated */
static __inline__ void IOReadLock( IORWLock * lock)
{ IORWLockRead(lock); }
static __inline__ void IOWriteLock( IORWLock * lock)
{ IORWLockWrite(lock); }
static __inline__ void IORWUnlock( IORWLock * lock)
{ IORWLockUnlock(lock); }
#endif /* IOKIT_DEPRECATED */