Simplify check. We are only able to check exclusive lock and if

2nd condition is true, first one is true for sure.

Approved by:	jhb, scottl (mentor)
This commit is contained in:
Pawel Jakub Dawidek 2004-02-19 14:19:31 +00:00
parent 41fe0c8ad5
commit f6739b1ddc
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=126003

View File

@ -348,8 +348,12 @@ _sx_assert(struct sx *sx, int what, const char *file, int line)
#ifdef WITNESS
witness_assert(&sx->sx_object, what, file, line);
#else
/*
* We are able to check only exclusive lock here,
* we cannot assert that *this* thread owns slock.
*/
mtx_lock(sx->sx_lock);
if (sx->sx_cnt != 0 && sx->sx_xholder == curthread)
if (sx->sx_xholder == curthread)
printf("Lock %s locked @ %s:%d\n",
sx->sx_object.lo_name, file, line);
mtx_unlock(sx->sx_lock);