diff options
author | arr <arr@FreeBSD.org> | 2002-04-02 16:05:43 +0000 |
---|---|---|
committer | arr <arr@FreeBSD.org> | 2002-04-02 16:05:43 +0000 |
commit | 6ae00dcc9fb5b7c3f2e1a9a8e1d46be9ef9c2568 (patch) | |
tree | 7db549b5279f56d4862f7911f8017c7f3767fd0d /sys/kern/kern_mutex.c | |
parent | abc96715734af1438114308215116e86454d062a (diff) | |
download | FreeBSD-src-6ae00dcc9fb5b7c3f2e1a9a8e1d46be9ef9c2568.zip FreeBSD-src-6ae00dcc9fb5b7c3f2e1a9a8e1d46be9ef9c2568.tar.gz |
- Add MTX_SYSINIT and SX_SYSINIT as macro glue for allowing sx and mtx
locks to be able to setup a SYSINIT call. This helps in places where
a lock is needed to protect some data, but the data is not truly
associated with a subsystem that can properly initialize it's lock.
The macros use the mtx_sysinit() and sx_sysinit() functions,
respectively, as the handler argument to SYSINIT().
Reviewed by: alfred, jhb, smp@
Diffstat (limited to 'sys/kern/kern_mutex.c')
-rw-r--r-- | sys/kern/kern_mutex.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c index a79398b..d5a1b09 100644 --- a/sys/kern/kern_mutex.c +++ b/sys/kern/kern_mutex.c @@ -782,6 +782,17 @@ mtx_validate(struct mtx *m) #endif /* + * General init routine used by the MTX_SYSINIT() macro. + */ +void +mtx_sysinit(void *arg) +{ + struct mtx_args *margs = arg; + + mtx_init(margs->ma_mtx, margs->ma_desc, margs->ma_opts); +} + +/* * Mutex initialization routine; initialize lock `m' of type contained in * `opts' with options contained in `opts' and description `description.' */ |