summaryrefslogtreecommitdiffstats
path: root/sys/sys
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2005-09-02 20:41:03 +0000
committerjhb <jhb@FreeBSD.org>2005-09-02 20:41:03 +0000
commitcd4dec717f59c0e685473b9aad85c638590ba6ac (patch)
treedfa7d8723b261fb1910f7dfd1f44d2ea5f17b203 /sys/sys
parent107f288b6f59f3cdf4f190acda16b304574701b2 (diff)
downloadFreeBSD-src-cd4dec717f59c0e685473b9aad85c638590ba6ac.zip
FreeBSD-src-cd4dec717f59c0e685473b9aad85c638590ba6ac.tar.gz
Add a SYSUNINIT() to SX_SYSINIT() to call sx_destroy() to destroy the sx
lock when a module is unloaded similar to the recent change made to MTX_SYSINIT(). Suggested by: pjd MFC after: 3 days
Diffstat (limited to 'sys/sys')
-rw-r--r--sys/sys/sx.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/sys/sx.h b/sys/sys/sx.h
index e7e6a2e..f88fb86 100644
--- a/sys/sys/sx.h
+++ b/sys/sys/sx.h
@@ -68,11 +68,13 @@ struct sx_args {
#define SX_SYSINIT(name, sxa, desc) \
static struct sx_args name##_args = { \
- sxa, \
- desc \
+ (sxa), \
+ (desc) \
}; \
SYSINIT(name##_sx_sysinit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \
- sx_sysinit, &name##_args)
+ sx_sysinit, &name##_args); \
+ SYSUNINIT(name##_sx_sysuninit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \
+ sx_destroy, (sxa))
#define sx_slock(sx) _sx_slock((sx), LOCK_FILE, LOCK_LINE)
#define sx_xlock(sx) _sx_xlock((sx), LOCK_FILE, LOCK_LINE)
OpenPOWER on IntegriCloud