Fix locking in arena_dirty_count().

This was a latent bug, since the function is (intentionally) not used.
This commit is contained in:
Jason Evans 2017-01-06 18:57:18 -08:00
parent 363629df88
commit d0a3129b88

View File

@ -639,12 +639,14 @@ arena_dirty_count(tsdn_t *tsdn, arena_t *arena)
extent_t *extent;
size_t ndirty = 0;
malloc_mutex_assert_owner(tsdn, &arena->extents_mtx);
malloc_mutex_lock(tsdn, &arena->extents_mtx);
for (extent = qr_next(&arena->extents_dirty, qr_link); extent !=
&arena->extents_dirty; extent = qr_next(extent, qr_link))
ndirty += extent_size_get(extent) >> LG_PAGE;
malloc_mutex_unlock(tsdn, &arena->extents_mtx);
return (ndirty);
}