diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-07-17 22:08:38 +0200 |
---|---|---|
committer | Clark Williams <williams@redhat.com> | 2012-02-15 10:32:54 -0600 |
commit | ddb5b25b72a57c2a15f31cb5f403689422c4e0af (patch) | |
tree | 4264e400e0ab88cd874cdc798b94c0210e34c791 /include/linux | |
parent | be7703457a3cdd753cdc2566d46da285ef6b805b (diff) |
timer-handle-idle-trylock-in-get-next-timer-irq.patch
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/spinlock_rt.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/include/linux/spinlock_rt.h b/include/linux/spinlock_rt.h index 205ca95a849e..3b555b4b52cf 100644 --- a/include/linux/spinlock_rt.h +++ b/include/linux/spinlock_rt.h @@ -51,7 +51,17 @@ extern void __lockfunc __rt_spin_unlock(struct rt_mutex *lock); #define spin_lock_irq(lock) spin_lock(lock) -#define spin_trylock(lock) __cond_lock(lock, rt_spin_trylock(lock)) +#define spin_do_trylock(lock) __cond_lock(lock, rt_spin_trylock(lock)) + +#define spin_trylock(lock) \ +({ \ + int __locked; \ + migrate_disable(); \ + __locked = spin_do_trylock(lock); \ + if (!__locked) \ + migrate_enable(); \ + __locked; \ +}) #ifdef CONFIG_LOCKDEP # define spin_lock_nested(lock, subclass) \ |