mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-03 09:00:21 +00:00
Invert the test of sx_xholder for SX_LOCKED. We need to warn if a
thread other than the curthread holds an sx. While I am here, break a line at the end of warning.
This commit is contained in:
parent
8df8626ebd
commit
98bf25aae1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=89496
@ -318,8 +318,8 @@ _sx_assert(struct sx *sx, int what, const char *file, int line)
|
||||
#else
|
||||
mtx_lock(sx->sx_lock);
|
||||
if (sx->sx_cnt <= 0 &&
|
||||
(what == SX_SLOCKED || sx->sx_xholder == curthread))
|
||||
printf("Lock %s not %slocked @ %s:%d",
|
||||
(what == SX_SLOCKED || sx->sx_xholder != curthread))
|
||||
printf("Lock %s not %slocked @ %s:%d\n",
|
||||
sx->sx_object.lo_name, (what == SX_SLOCKED) ?
|
||||
"share " : "", file, line);
|
||||
mtx_unlock(sx->sx_lock);
|
||||
@ -328,7 +328,7 @@ _sx_assert(struct sx *sx, int what, const char *file, int line)
|
||||
case SX_XLOCKED:
|
||||
mtx_lock(sx->sx_lock);
|
||||
if (sx->sx_xholder != curthread)
|
||||
printf("Lock %s not exclusively locked @ %s:%d",
|
||||
printf("Lock %s not exclusively locked @ %s:%d\n",
|
||||
sx->sx_object.lo_name, file, line);
|
||||
mtx_unlock(sx->sx_lock);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user