mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-21 15:45:02 +00:00
Allow assert that the current thread does not hold the sx(9) lock.
Reviewed by: jhb In cooperation with: juli, jhb Approved by: jhb, scottl (mentor)
This commit is contained in:
parent
2ccbe4b596
commit
19b0efd32d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=125421
@ -344,6 +344,17 @@ _sx_assert(struct sx *sx, int what, const char *file, int line)
|
||||
sx->sx_object.lo_name, file, line);
|
||||
mtx_unlock(sx->sx_lock);
|
||||
break;
|
||||
case SX_UNLOCKED:
|
||||
#ifdef WITNESS
|
||||
witness_assert(&sx->sx_object, what, file, line);
|
||||
#else
|
||||
mtx_lock(sx->sx_lock);
|
||||
if (sx->sx_cnt != 0 && sx->sx_xholder == curthread)
|
||||
printf("Lock %s locked @ %s:%d\n",
|
||||
sx->sx_object.lo_name, file, line);
|
||||
mtx_unlock(sx->sx_lock);
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
panic("Unknown sx lock assertion: %d @ %s:%d", what, file,
|
||||
line);
|
||||
|
Loading…
Reference in New Issue
Block a user