Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/subr_kobj.c
Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | |||||
static int kobj_mutex_inited; | static int kobj_mutex_inited; | ||||
static int kobj_next_id = 1; | static int kobj_next_id = 1; | ||||
#define KOBJ_LOCK() mtx_lock(&kobj_mtx) | #define KOBJ_LOCK() mtx_lock(&kobj_mtx) | ||||
#define KOBJ_UNLOCK() mtx_unlock(&kobj_mtx) | #define KOBJ_UNLOCK() mtx_unlock(&kobj_mtx) | ||||
#define KOBJ_ASSERT(what) mtx_assert(&kobj_mtx, what); | #define KOBJ_ASSERT(what) mtx_assert(&kobj_mtx, what); | ||||
SYSCTL_INT(_kern, OID_AUTO, kobj_methodcount, CTLFLAG_RD, | SYSCTL_INT(_kern, OID_AUTO, kobj_methodcount, CTLFLAG_RD, | ||||
&kobj_next_id, 0, ""); | &kobj_next_id, 0, | ||||
"Number of kernel object methods registered"); | |||||
kaktus: And too :-) | |||||
static void | static void | ||||
kobj_init_mutex(void *arg) | kobj_init_mutex(void *arg) | ||||
{ | { | ||||
if (!kobj_mutex_inited) { | if (!kobj_mutex_inited) { | ||||
mtx_init(&kobj_mtx, "kobj", NULL, MTX_DEF); | mtx_init(&kobj_mtx, "kobj", NULL, MTX_DEF); | ||||
kobj_mutex_inited = 1; | kobj_mutex_inited = 1; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 273 Lines • Show Last 20 Lines |
And too :-)