From f2b5c99b4c83346d505fc58e78d677000b04c7d4 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 29 Jan 2018 15:24:37 +0100 Subject: [PATCH] CLEANUP: fd/threads: remove the now unused fdtab_lock It was only used to protect maxfd computation and is not needed anymore. --- include/common/hathreads.h | 1 - include/proto/fd.h | 1 - src/fd.c | 3 --- 3 files changed, 5 deletions(-) diff --git a/include/common/hathreads.h b/include/common/hathreads.h index cfcb48e9b..fe1ee231e 100644 --- a/include/common/hathreads.h +++ b/include/common/hathreads.h @@ -203,7 +203,6 @@ int thread_need_sync(void); enum lock_label { THREAD_SYNC_LOCK = 0, - FDTAB_LOCK, FDCACHE_LOCK, FD_LOCK, POLL_LOCK, diff --git a/include/proto/fd.h b/include/proto/fd.h index 76d4c7e59..c9449ff86 100644 --- a/include/proto/fd.h +++ b/include/proto/fd.h @@ -40,7 +40,6 @@ extern unsigned long fd_cache_mask; // Mask of threads with events in the cache extern THREAD_LOCAL int *fd_updt; // FD updates list extern THREAD_LOCAL int fd_nbupdt; // number of updates in the list -__decl_hathreads(extern HA_SPINLOCK_T __attribute__((aligned(64))) fdtab_lock); /* global lock to protect fdtab array */ __decl_hathreads(extern HA_RWLOCK_T __attribute__((aligned(64))) fdcache_lock); /* global lock to protect fd_cache array */ __decl_hathreads(extern HA_SPINLOCK_T __attribute__((aligned(64))) poll_lock); /* global lock to protect poll info */ diff --git a/src/fd.c b/src/fd.c index 1fa170b58..9398364e4 100644 --- a/src/fd.c +++ b/src/fd.c @@ -174,7 +174,6 @@ unsigned long fd_cache_mask = 0; // Mask of threads with events in the cache THREAD_LOCAL int *fd_updt = NULL; // FD updates list THREAD_LOCAL int fd_nbupdt = 0; // number of updates in the list -__decl_hathreads(HA_SPINLOCK_T fdtab_lock); /* global lock to protect fdtab array */ __decl_hathreads(HA_RWLOCK_T fdcache_lock); /* global lock to protect fd_cache array */ __decl_hathreads(HA_SPINLOCK_T poll_lock); /* global lock to protect poll info */ @@ -332,7 +331,6 @@ int init_pollers() for (p = 0; p < global.maxsock; p++) HA_SPIN_INIT(&fdtab[p].lock); - HA_SPIN_INIT(&fdtab_lock); HA_RWLOCK_INIT(&fdcache_lock); HA_SPIN_INIT(&poll_lock); do { @@ -381,7 +379,6 @@ void deinit_pollers() { free(fdinfo); fdinfo = NULL; free(fdtab); fdtab = NULL; - HA_SPIN_DESTROY(&fdtab_lock); HA_RWLOCK_DESTROY(&fdcache_lock); HA_SPIN_DESTROY(&poll_lock); }