MFp4 180933:
Initialize rw_count properly so that zdb(8) doesn't trigger assertion in rw_enter(): ASSERT(rwlp->rw_count == 0); While here, assert that rw_count is 0 when destroying the lock. MFC after: 1 week
This commit is contained in:
parent
b995e62fd0
commit
0356e5fcb5
@ -174,11 +174,13 @@ rw_init(krwlock_t *rwlp, char *name, int type, void *arg)
|
||||
rwlock_init(&rwlp->rw_lock, USYNC_THREAD, NULL);
|
||||
rwlp->rw_owner = NULL;
|
||||
rwlp->initialized = B_TRUE;
|
||||
rwlp->rw_count = 0;
|
||||
}
|
||||
|
||||
void
|
||||
rw_destroy(krwlock_t *rwlp)
|
||||
{
|
||||
ASSERT(rwlp->rw_count == 0);
|
||||
rwlock_destroy(&rwlp->rw_lock);
|
||||
rwlp->rw_owner = (void *)-1UL;
|
||||
rwlp->initialized = B_FALSE;
|
||||
|
Loading…
x
Reference in New Issue
Block a user