kernels/linux-2.4.0/arch/ia64/kernel/semaphore.c
/*
 * Trylock failed - make sure we correct for having decremented the
 * count.
 */
Trylock failed - make sure we correct for having decremented the
count.
Trylock failed - make sure we correct for having decremented the count .
int
__down_trylock (struct semaphore *sem)
{
	unsigned long flags;
	int sleepers;
	spin_lock_irqsave(&semaphore_lock, flags);
	sleepers = sem->sleepers + 1;
	sem->sleepers = 0;
	if (!atomic_add_negative(sleepers, &sem->count))
		wake_up(&sem->wait);
	spin_unlock_irqrestore(&semaphore_lock, flags);
	return 1;
}
int __down_trylock ( struct semaphore * sem ) { unsigned long flags ; int sleepers ; spin_lock_irqsave ( & semaphore_lock , flags ) ; sleepers = sem -> sleepers + 1 ; sem -> sleepers = 0 ; if ( ! atomic_add_negative ( sleepers , & sem -> count ) ) wake_up ( & sem -> wait ) ; spin_unlock_irqrestore ( & semaphore_lock , flags ) ; return 1 ; }
Trylock failed - make sure we correct for having decremented the
 count.
Trylock failed - make sure we correct for having decremented the count .
/*
	 * Add "everybody else" and us into it. They aren't
	 * playing, because we own the spinlock.
	 */