tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: How to destroy a condvar(9) with waiters?



> The destroyer would need the same logic to handle the case where there are no waiters.

Sorry, I should have been clearer. The (virtual) destroyer routine
checks for that condition:

if (port->kp_waiters > 0) {
  port->kp_state = kp_deleted;
  cv_broadcast(&port->kp_rdcv);
  cv_broadcast(&port->kp_wrcv);
  mutex_exit(&port->kp_interlock);
}
else {
  kport_delete_physical(port);
}


Home | Main Index | Thread Index | Old Index