Fix this to actually compile in the !INVARIANTS case.
Reported by: Maxime Henrion <mux@qualys.com>
This commit is contained in:
parent
9a024fc559
commit
781a35df6b
@ -48,6 +48,10 @@ struct lock_class lock_class_sx = {
|
||||
LC_SLEEPLOCK | LC_SLEEPABLE | LC_RECURSABLE | LC_UPGRADABLE
|
||||
};
|
||||
|
||||
#ifndef INVARIANTS
|
||||
#define _sx_assert(sx, what, file, line)
|
||||
#endif
|
||||
|
||||
void
|
||||
sx_init(struct sx *sx, const char *description)
|
||||
{
|
||||
@ -294,6 +298,10 @@ _sx_downgrade(struct sx *sx, const char *file, int line)
|
||||
}
|
||||
|
||||
#ifdef INVARIANT_SUPPORT
|
||||
#ifndef INVARIANTS
|
||||
#undef _sx_assert
|
||||
#endif
|
||||
|
||||
/*
|
||||
* In the non-WITNESS case, sx_assert() can only detect that at least
|
||||
* *some* thread owns an slock, but it cannot guarantee that *this*
|
||||
|
@ -70,11 +70,13 @@ void _sx_assert(struct sx *sx, int what, const char *file, int line);
|
||||
#define sx_try_upgrade(sx) _sx_try_upgrade((sx), LOCK_FILE, LOCK_LINE)
|
||||
#define sx_downgrade(sx) _sx_downgrade((sx), LOCK_FILE, LOCK_LINE)
|
||||
|
||||
#ifdef INVARIANTS
|
||||
#if defined(INVARIANTS) || defined(INVARIANT_SUPPORT)
|
||||
#define SX_LOCKED LA_LOCKED
|
||||
#define SX_SLOCKED LA_SLOCKED
|
||||
#define SX_XLOCKED LA_XLOCKED
|
||||
#endif /* INVARIANTS || INVARIANT_SUPPORT */
|
||||
|
||||
#ifdef INVARIANTS
|
||||
#define sx_assert(sx, what) _sx_assert((sx), (what), LOCK_FILE, LOCK_LINE)
|
||||
#else /* INVARIANTS */
|
||||
#define sx_assert(sx, what)
|
||||
|
Loading…
Reference in New Issue
Block a user