pgpool2.git / summary / log / commit / refs

commit    8785ebda65388820cd05dbfc1436ed649e161ec0
Author:   Tatsuo Ishii <ishii@sraoss.co.jp>
Date:     Sat Sep 24 02:55:03 2022 +0000

    Remove unused semaphore number.
    
    Commit dc559c07ee5affc7035efa6e0f00185e211079a0 replaced use of
    semaphore with flock. Thus the semaphore number is no longer
    necessary.


src/include/pool.h | 15 +++++++-------- src/query_cache/pool_memqcache.c | 6 ------ 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/include/pool.h b/src/include/pool.h index c8d97abfd..e37380d66 100644 --- a/src/include/pool.h +++ b/src/include/pool.h @@ -379,16 +379,15 @@ typedef enum #define Min(x, y) ((x) < (y) ? (x) : (y)) -#define MAX_NUM_SEMAPHORES 9 +#define MAX_NUM_SEMAPHORES 8 #define CONN_COUNTER_SEM 0 #define REQUEST_INFO_SEM 1 -#define SHM_CACHE_SEM 2 -#define QUERY_CACHE_STATS_SEM 3 -#define PCP_REQUEST_SEM 4 -#define ACCEPT_FD_SEM 5 -#define SI_CRITICAL_REGION_SEM 6 -#define FOLLOW_PRIMARY_SEM 7 -#define MAIN_EXIT_HANDLER_SEM 8 /* used in exit_hander in pgpool main process */ +#define QUERY_CACHE_STATS_SEM 2 +#define PCP_REQUEST_SEM 3 +#define ACCEPT_FD_SEM 4 +#define SI_CRITICAL_REGION_SEM 5 +#define FOLLOW_PRIMARY_SEM 6 +#define MAIN_EXIT_HANDLER_SEM 7 /* used in exit_hander in pgpool main process */ #define MAX_REQUEST_QUEUE_SIZE 10 #define MAX_SEC_WAIT_FOR_CLUSTER_TRANSACTION 10 /* time in seconds to keep diff --git a/src/query_cache/pool_memqcache.c b/src/query_cache/pool_memqcache.c index e070be7a3..6f90c6393 100644 --- a/src/query_cache/pool_memqcache.c +++ b/src/query_cache/pool_memqcache.c @@ -2950,9 +2950,6 @@ pool_shmem_lock(POOL_MEMQ_LOCK_TYPE type) { if (pool_is_shmem_cache() && !is_shmem_locked) { -#ifdef NOT_USED - pool_semaphore_lock(SHM_CACHE_SEM); -#endif if (flock(memq_lock_fd, type == POOL_MEMQ_EXCLUSIVE_LOCK? LOCK_EX : LOCK_SH)) { ereport(FATAL, @@ -2971,9 +2968,6 @@ pool_shmem_unlock(void) { if (pool_is_shmem_cache() && is_shmem_locked) { -#ifdef NOT_USED - pool_semaphore_unlock(SHM_CACHE_SEM); -#endif if (flock(memq_lock_fd, LOCK_UN)) { ereport(FATAL, [parent: 57bdabb6b471]