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:
Pawel Jakub Dawidek 2010-07-14 06:37:43 +00:00
parent b995e62fd0
commit 0356e5fcb5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=210044

View File

@ -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;