Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_condvar.c
Show First 20 Lines • Show All 449 Lines • ▼ Show 20 Lines | cv_broadcastpri(struct cv *cvp, int pri) | ||||
if (cvp->cv_waiters > 0) { | if (cvp->cv_waiters > 0) { | ||||
cvp->cv_waiters = 0; | cvp->cv_waiters = 0; | ||||
wakeup_swapper = sleepq_broadcast(cvp, SLEEPQ_CONDVAR, pri, 0); | wakeup_swapper = sleepq_broadcast(cvp, SLEEPQ_CONDVAR, pri, 0); | ||||
} | } | ||||
sleepq_release(cvp); | sleepq_release(cvp); | ||||
if (wakeup_swapper) | if (wakeup_swapper) | ||||
kick_proc0(); | kick_proc0(); | ||||
} | } | ||||
/* | |||||
* Return true if one or more LWPs are waiting on the specified | |||||
* condition variable. | |||||
*/ | |||||
bool | |||||
cv_has_waiters(struct cv *cvp) | |||||
{ | |||||
smh: ASSERT that the lock is held? | |||||
if (cvp->cv_waiters > 0) | |||||
smhUnsubmitted Not Done Inline Actionsstyle(9) there should be blank line at the beginning of methods that don't have any vars. smh: style(9) there should be blank line at the beginning of methods that don't have any vars. | |||||
return (TRUE); | |||||
else | |||||
smhUnsubmitted Not Done Inline ActionsNo need for else here smh: No need for else here | |||||
return (FALSE); | |||||
} |
ASSERT that the lock is held?