kernels/linux-2.4.0/arch/ia64/kernel/semaphore.c
/*
 * This gets called if we failed to acquire the lock and we are not
 * biased to acquire the lock.  We undo the decrement that was
 * done earlier, go to sleep, and then attempt to re-acquire the
 * lock afterwards.
 */
This gets called if we failed to acquire the lock and we are not
biased to acquire the lock.  We undo the decrement that was
done earlier, go to sleep, and then attempt to re-acquire the
lock afterwards.
This gets called if we failed to acquire the lock and we are not biased to acquire the lock . We undo the decrement that was done earlier go to sleep and then attempt to re - acquire the lock afterwards .
static inline void
down_read_failed (struct rw_semaphore *sem)
{
	struct task_struct *tsk = current;
	DECLARE_WAITQUEUE(wait, tsk);
	__up_read(sem);
	add_wait_queue(&sem->wait, &wait);
	while (sem->count < 0) {
		set_task_state(tsk, TASK_UNINTERRUPTIBLE);
		if (sem->count >= 0)
			break;
		schedule();
	}
	remove_wait_queue(&sem->wait, &wait);
	tsk->state = TASK_RUNNING;
}
static inline void down_read_failed ( struct rw_semaphore * sem ) { struct task_struct * tsk = current ; DECLARE_WAITQUEUE ( wait , tsk ) ; __up_read ( sem ) ; add_wait_queue ( & sem -> wait , & wait ) ; while ( sem -> count < 0 ) { set_task_state ( tsk , TASK_UNINTERRUPTIBLE ) ; if ( sem -> count >= 0 ) break ; schedule ( ) ; } remove_wait_queue ( & sem -> wait , & wait ) ; tsk -> state = TASK_RUNNING ; }
This gets called if we failed to acquire the lock and we are not
 biased to acquire the lock.
This gets called if we failed to acquire the lock and we are not biased to acquire the lock .
/*
	 * Undo the decrement we did in down_read() and check if we
	 * need to wake up someone.
	 */