File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -492,6 +492,9 @@ static void disjoint_pool_print_stats(disjoint_pool_t *pool) {
492
492
493
493
for (size_t i = 0 ; i < pool -> buckets_num ; i ++ ) {
494
494
bucket_t * bucket = pool -> buckets [i ];
495
+ // lock bucket before accessing its stats
496
+ utils_mutex_lock (& bucket -> bucket_lock );
497
+
495
498
if (bucket -> alloc_count ) {
496
499
LOG_DEBUG ("%14zu %12zu %12zu %18zu %20zu %21zu" , bucket -> size ,
497
500
bucket -> alloc_count , bucket -> free_count ,
@@ -500,8 +503,11 @@ static void disjoint_pool_print_stats(disjoint_pool_t *pool) {
500
503
high_bucket_size =
501
504
utils_max (bucket_slab_alloc_size (bucket ), high_bucket_size );
502
505
}
506
+
503
507
high_peak_slabs_in_use =
504
508
utils_max (bucket -> max_slabs_in_use , high_peak_slabs_in_use );
509
+
510
+ utils_mutex_unlock (& bucket -> bucket_lock );
505
511
}
506
512
507
513
LOG_DEBUG ("current pool size: %zu" ,
You can’t perform that action at this time.
0 commit comments