}
} else {  if (  rwlock->rw_waiting_writers == 0 && rwlock->rw_waiting_readers > 0) PZ_NotifyAllCondVar(rwlock->rw_reader_waitq); }
NSSRWLock_UnlockWrite(NSSRWLock *rwlock){    PRThread *me = PR_GetCurrentThread();    PZ_Lock(rwlock->rw_lock);    PR_ASSERT(rwlock->rw_owner == me); /* lock must be write-locked by me.  */    PR_ASSERT(rwlock->rw_writer_locks > 0); /* lock must be write locked */    if (  rwlock->rw_owner        == me  &&	/* I own it, and            */          rwlock->rw_writer_locks  > 0   &&	/* I own it, and            */        --rwlock->rw_writer_locks == 0) {	/* I'm all done with it     */	rwlock->rw_owner = NULL;		/* I don't own it any more. */	if (rwlock->rw_reader_locks == 0) { /* no readers, wake up somebody. */	    /* Give preference to waiting writers. */	    if (rwlock->rw_waiting_writers > 0) 		PZ_NotifyCondVar(rwlock->rw_writer_waitq);	    else if (rwlock->rw_waiting_readers > 0)		PZ_NotifyAllCondVar(rwlock->rw_reader_waitq);	}    }    PZ_Unlock(rwlock->rw_lock);#ifdef NSS_RWLOCK_RANK_ORDER_DEBUG    /*     * update thread's lock rank     */    nssRWLock_UnsetThreadRank(me, rwlock);#endif    return;}