kernels/linux-2.4.0/arch/ia64/kernel/semaphore.c
/*
 * Wait for the lock to become unbiased.  Since we're a writer, we'll
 * make ourselves exclusive.
 */
Wait for the lock to become unbiased.  Since we're a writer, we'll
make ourselves exclusive.
Wait for the lock to become unbiased . Since we ' re a writer we ' ll make ourselves exclusive .
void
__down_write_failed (struct rw_semaphore *sem, long count)
{
	long old_count;
	while (1) {
		if (count == -RW_LOCK_BIAS) {
			down_write_failed_biased(sem);
			return;
		}
		down_write_failed(sem);
		do {
			old_count = sem->count;
			count = old_count - RW_LOCK_BIAS;
		} while (cmpxchg_acq(&sem->count, old_count, count) != old_count);
		if (count == 0)
			return;
	}
}
void __down_write_failed ( struct rw_semaphore * sem , long count ) { long old_count ; while ( 1 ) { if ( count == - RW_LOCK_BIAS ) { down_write_failed_biased ( sem ) ; return ; } down_write_failed ( sem ) ; do { old_count = sem -> count ; count = old_count - RW_LOCK_BIAS ; } while ( cmpxchg_acq ( & sem -> count , old_count , count ) != old_count ) ; if ( count == 0 ) return ; } }
Wait for the lock to become unbiased.
Wait for the lock to become unbiased .