示例#1
0
static inline void
rt_mutex_fastunlock(struct rt_mutex *lock,
		    void (*slowfn)(struct rt_mutex *lock))
{
	if (likely(rt_mutex_cmpxchg(lock, current, NULL)))
		rt_mutex_deadlock_account_unlock(current);
	else
		slowfn(lock);
}
示例#2
0
static inline void
rt_spin_lock_fastlock(struct rt_mutex *lock,
		void fastcall (*slowfn)(struct rt_mutex *lock))
{
	if (likely(rt_mutex_cmpxchg(lock, NULL, current)))
		rt_mutex_deadlock_account_lock(lock, current);
	else
		slowfn(lock);
}
示例#3
0
static inline int
rt_mutex_fasttrylock(struct rt_mutex *lock,
		     int (*slowfn)(struct rt_mutex *lock))
{
	if (likely(rt_mutex_cmpxchg(lock, NULL, current))) {
		rt_mutex_deadlock_account_lock(lock, current);
		return 1;
	}
	return slowfn(lock);
}
示例#4
0
static inline int
rt_mutex_timed_fastlock(struct rt_mutex *lock, int state,
			struct hrtimer_sleeper *timeout, int detect_deadlock,
			int (*slowfn)(struct rt_mutex *lock, int state,
				      struct hrtimer_sleeper *timeout,
				      int detect_deadlock))
{
	if (!detect_deadlock && likely(rt_mutex_cmpxchg(lock, NULL, current))) {
		rt_mutex_deadlock_account_lock(lock, current);
		return 0;
	} else
		return slowfn(lock, state, timeout, detect_deadlock);
}
示例#5
0
static inline void
rt_spin_lock_fastunlock(struct rt_mutex *lock,
			void  (*slowfn)(struct rt_mutex *lock))
{
	/* Temporary HACK! */
	if (unlikely(rt_mutex_owner(lock) != current) && current->in_printk)
		/* don't grab locks for printk in atomic */
		return;

	if (likely(rt_mutex_cmpxchg(lock, current, NULL)))
		rt_mutex_deadlock_account_unlock(current);
	else
		slowfn(lock);
}
示例#6
0
static inline void
rt_spin_lock_fastlock(struct rt_mutex *lock,
		void  (*slowfn)(struct rt_mutex *lock))
{
	/* Temporary HACK! */
	if (likely(!current->in_printk))
		might_sleep();
	else if (in_atomic() || irqs_disabled())
		/* don't grab locks for printk in atomic */
		return;

	if (likely(rt_mutex_cmpxchg(lock, NULL, current)))
		rt_mutex_deadlock_account_lock(lock, current);
	else
		slowfn(lock);
}