kernels/linux-2.4.0/include/asm-alpha/semaphore.h
/* Releasing the writer is easy -- just release it and wake up
   any sleepers.  */
Releasing the writer is easy -- just release it and wake up
any sleepers.
Releasing the writer is easy -- just release it and wake up any sleepers .
static inline void __up_write(struct rw_semaphore *sem)
{
	long count, wake;
	mb();
	count = atomic_add_return(RW_LOCK_BIAS, &sem->count);
	wake = ((int)(count - RW_LOCK_BIAS) < 0) && count >= 0;
	if (__builtin_expect(wake, 0))
		__rwsem_wake(sem, count);
}
static inline void __up_write ( struct rw_semaphore * sem ) { long count , wake ; mb ( ) ; count = atomic_add_return ( RW_LOCK_BIAS , & sem -> count ) ; wake = ( ( int ) ( count - RW_LOCK_BIAS ) < 0 ) && count >= 0 ; if ( __builtin_expect ( wake , 0 ) ) __rwsem_wake ( sem , count ) ; }
Releasing the writer is easy -- just release it and wake up
any sleepers.
Releasing the writer is easy -- just release it and wake up any sleepers .
/* Only do the wake if we were, but are no longer, negative.  */