void rwlock_any_down(rwlock_t *r) { assert(r); assert(!critical_inside(__CRITICAL_HARDER(CRITICAL_SCHED_LOCK))); sched_lock(); { r->count--; if (r->count == 0) { r->status = RWLOCK_STATUS_NONE; waitq_wakeup_all(&r->wq); } } sched_unlock(); }
static void scsi_wake(struct scsi_dev *dev, int res) { dev->cmd_complete = res; waitq_wakeup_all(&dev->wq); }