Exemplo n.º 1
0
void __lockfunc rt_read_lock(rwlock_t *rwlock)
{
	struct rt_mutex *lock = &rwlock->lock;

	rwlock_acquire_read(&rwlock->dep_map, 0, 0, _RET_IP_);

	/*
	 * recursive read locks succeed when current owns the lock
	 */
	if (rt_mutex_real_owner(lock) != current)
		__rt_spin_lock(lock);
	rwlock->read_depth++;
}
Exemplo n.º 2
0
void __lockfunc rt_read_lock(rwlock_t *rwlock)
{
	unsigned long flags;
	struct rt_mutex *lock = &rwlock->lock;

	rwlock_acquire_read(&rwlock->dep_map, 0, 0, _RET_IP_);
	/*
	 * Read locks within the write lock succeed.
	 */
	spin_lock_irqsave(&lock->wait_lock, flags);
	if (rt_mutex_real_owner(lock) == current) {
		spin_unlock_irqrestore(&lock->wait_lock, flags);
		rwlock->read_depth++;
		return;
	}
	spin_unlock_irqrestore(&lock->wait_lock, flags);
	__rt_spin_lock(lock);
}
Exemplo n.º 3
0
void __lockfunc rt_write_lock(rwlock_t *rwlock)
{
	rwlock_acquire(&rwlock->dep_map, 0, 0, _RET_IP_);
	__rt_spin_lock(&rwlock->lock);
}