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
This commit is contained in:
parent
acc0265cc2
commit
b3c04741dd
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user