From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Vladimir Davydov Subject: [PATCH 6/8] vinyl: zap vy_worker_pool::idle_worker_count Date: Tue, 4 Sep 2018 20:23:49 +0300 Message-Id: In-Reply-To: References: <20180904115404.el6kdswgitsnopgf@esperanza> In-Reply-To: References: To: kostja@tarantool.org Cc: tarantool-patches@freelists.org List-ID: It is not used anywhere anymore. --- src/box/vy_scheduler.c | 6 ------ src/box/vy_scheduler.h | 2 -- 2 files changed, 8 deletions(-) diff --git a/src/box/vy_scheduler.c b/src/box/vy_scheduler.c index dbc3ca69..4f57c0a0 100644 --- a/src/box/vy_scheduler.c +++ b/src/box/vy_scheduler.c @@ -340,7 +340,6 @@ vy_worker_pool_start(struct vy_worker_pool *pool) { assert(pool->workers == NULL); - pool->idle_worker_count = pool->size; pool->workers = calloc(pool->size, sizeof(*pool->workers)); if (pool->workers == NULL) panic("failed to allocate vinyl worker pool"); @@ -385,7 +384,6 @@ vy_worker_pool_create(struct vy_worker_pool *pool, const char *name, int size) pool->size = size; pool->workers = NULL; stailq_create(&pool->idle_workers); - pool->idle_worker_count = 0; } static void @@ -403,8 +401,6 @@ vy_worker_pool_get(struct vy_worker_pool *pool) { struct vy_worker *worker = NULL; if (!stailq_empty(&pool->idle_workers)) { - assert(pool->idle_worker_count > 0); - pool->idle_worker_count--; worker = stailq_shift_entry(&pool->idle_workers, struct vy_worker, in_idle); assert(worker->pool == pool); @@ -420,8 +416,6 @@ static void vy_worker_pool_put(struct vy_worker *worker) { struct vy_worker_pool *pool = worker->pool; - assert(pool->idle_worker_count < pool->size); - pool->idle_worker_count++; stailq_add_entry(&pool->idle_workers, worker, in_idle); } diff --git a/src/box/vy_scheduler.h b/src/box/vy_scheduler.h index 7014f953..841d5a53 100644 --- a/src/box/vy_scheduler.h +++ b/src/box/vy_scheduler.h @@ -65,8 +65,6 @@ struct vy_worker_pool { struct vy_worker *workers; /** List of workers that are currently idle. */ struct stailq idle_workers; - /** Length of @idle_workers list. */ - int idle_worker_count; }; struct vy_scheduler { -- 2.11.0