void sysctl_register_oid(struct sysctl_oid *oidp) { SYSCTL_XLOCK(); sysctl_register_oid_int(oidp); SYSCTL_XUNLOCK(); }
static int sysctl_cancel_lock(SYSCTL_HANDLER_ARGS) { int error; if (req->newptr) { SYSCTL_XUNLOCK(); lockmgr(&cancel_lk, LK_EXCLUSIVE); kprintf("x"); error = tsleep(&error, PCATCH, "canmas", hz * 5); lockmgr(&cancel_lk, LK_CANCEL_BEG); kprintf("y"); error = tsleep(&error, PCATCH, "canmas", hz * 5); kprintf("z"); lockmgr(&cancel_lk, LK_RELEASE); SYSCTL_XLOCK(); SYSCTL_OUT(req, &error, sizeof(error)); } error = 0; return error; }