dahdi: Support "struct mutex" on pre 2.6.16 kernels.
'struct mutex' was introduced in 2.6.16. While DAHDI previously allowed statically allocated mutexes, this change is required in order to allow mutexes to be embedded in dynamically allocated structures on older kernels. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9938 a0bf4364-ded3-4de4-8d8a-66a801d63aff
This commit is contained in:
parent
ca9d290af1
commit
c1e491930b
@ -1381,9 +1381,16 @@ typedef u32 __bitwise pm_message_t;
|
||||
#endif
|
||||
|
||||
#ifndef DEFINE_MUTEX
|
||||
#define DEFINE_MUTEX DEFINE_SEMAPHORE
|
||||
#define mutex_lock(_x) down(_x)
|
||||
#define mutex_unlock(_x) up(_x)
|
||||
struct mutex {
|
||||
struct semaphore sem;
|
||||
};
|
||||
#define DEFINE_MUTEX(name) \
|
||||
struct mutex name = { \
|
||||
.sem = __SEMAPHORE_INITIALIZER((name).sem, 1), \
|
||||
}
|
||||
#define mutex_lock(_x) down(&(_x)->sem)
|
||||
#define mutex_unlock(_x) up(&(_x)->sem)
|
||||
#define mutex_init(_x) sema_init(&(_x)->sem, 1)
|
||||
#endif
|
||||
|
||||
#ifndef DEFINE_PCI_DEVICE_TABLE
|
||||
|
Loading…
Reference in New Issue
Block a user