Example #1
0
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();
}
Example #2
0
static void scsi_wake(struct scsi_dev *dev, int res) {
	dev->cmd_complete = res;
	waitq_wakeup_all(&dev->wq);
}