> 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); }