From 00dc09ae5fbd0c8aebb5c3c86241a75c02bc0624 Mon Sep 17 00:00:00 2001 From: Dmitry Simonenko Date: Mon, 12 Feb 2018 16:28:46 +0300 Subject: [PATCH] shapito: add shapito_cache_stat() --- shapito/cache.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/shapito/cache.h b/shapito/cache.h index 12bd431b..801a1e21 100644 --- a/shapito/cache.h +++ b/shapito/cache.h @@ -78,4 +78,13 @@ shapito_cache_push(shapito_cache_t *cache, shapito_stream_t *stream) pthread_spin_unlock(&cache->lock); } +static inline void +shapito_cache_stat(shapito_cache_t *cache, int *count, int *count_allocated) +{ + pthread_spin_lock(&cache->lock); + *count = cache->count; + *count_allocated = cache->count_allocated; + pthread_spin_unlock(&cache->lock); +} + #endif /* SHAPITO_CACHE_H */