kernels/linux-2.4.0/arch/parisc/kernel/semaphore.c
/* Wait for the lock to become unbiased.  Readers
 * are non-exclusive. =)
 */
Wait for the lock to become unbiased.  Readers
are non-exclusive.
Wait for the lock to become unbiased . Readers are non - exclusive .
void down_read_failed(struct rw_semaphore *sem)
{
	DECLARE_WAITQUEUE(wait, current);
	__up_read(sem);	
	add_wait_queue(&sem->wait, &wait);
	while (atomic_read(&sem->count) < 0) {
		set_task_state(current, TASK_UNINTERRUPTIBLE);
		if (atomic_read(&sem->count) >= 0)
			break;
		schedule();
	}
	remove_wait_queue(&sem->wait, &wait);
	current->state = TASK_RUNNING;
}
void down_read_failed ( struct rw_semaphore * sem ) { DECLARE_WAITQUEUE ( wait , current ) ; __up_read ( sem ) ; add_wait_queue ( & sem -> wait , & wait ) ; while ( atomic_read ( & sem -> count ) < 0 ) { set_task_state ( current , TASK_UNINTERRUPTIBLE ) ; if ( atomic_read ( & sem -> count ) >= 0 ) break ; schedule ( ) ; } remove_wait_queue ( & sem -> wait , & wait ) ; current -> state = TASK_RUNNING ; }
Wait for the lock to become unbiased.
Wait for the lock to become unbiased .
/* this takes care of granting the lock */