while (acquire_sem_etc(cvar->handshakeSem, handshakes, 0, 0) == B_INTERRUPTED) { err = B_INTERRUPTED; } } else { if( atomic_add( &cvar->signalBenCount, -1 ) > 1 ) { release_sem(cvar->signalSem); } }
PR_IMPLEMENT(PRStatus)    PR_NotifyAllCondVar (PRCondVar *cvar){    sem_info semInfo;    if( get_sem_info( cvar->isem, &semInfo ) != B_NO_ERROR )	return PR_FAILURE;    if( release_sem_etc( cvar->isem, semInfo.count, 0 ) != B_NO_ERROR )	return PR_FAILURE;    return PR_SUCCESS;}