summaryrefslogtreecommitdiff
path: root/src/include/storage/ipc.h
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2025-11-06 14:45:00 +0200
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2025-11-06 14:45:00 +0200
commitaa9c5fd3e3d7f1e6154474e39ab71377136d463a (patch)
treef061ab14e14dacd5f360ce892cca2a1b7038c096 /src/include/storage/ipc.h
parentdaf3d99d2b8bebb3361163a11ef3d232002127c9 (diff)
Refactor shared memory allocation for semaphores
Before commit e25626677f, spinlocks were implemented using semaphores on some platforms (--disable-spinlocks). That made it necessary to initialize semaphores early, before any spinlocks could be used. Now that we don't support --disable-spinlocks anymore, we can allocate the shared memory needed for semaphores the same way as other shared memory structures. Since the semaphores are used only in the PGPROC array, move the semaphore shmem size estimation and initialization calls to ProcGlobalShmemSize() and InitProcGlobal(). Author: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com> Discussion: https://www.postgresql.org/message-id/CAExHW5seSZpPx-znjidVZNzdagGHOk06F+Ds88MpPUbxd1kTaA@mail.gmail.com
Diffstat (limited to 'src/include/storage/ipc.h')
-rw-r--r--src/include/storage/ipc.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/include/storage/ipc.h b/src/include/storage/ipc.h
index 3baf418b3d1..2a8a8f0eabd 100644
--- a/src/include/storage/ipc.h
+++ b/src/include/storage/ipc.h
@@ -77,7 +77,7 @@ extern void check_on_shmem_exit_lists_are_empty(void);
/* ipci.c */
extern PGDLLIMPORT shmem_startup_hook_type shmem_startup_hook;
-extern Size CalculateShmemSize(int *num_semaphores);
+extern Size CalculateShmemSize(void);
extern void CreateSharedMemoryAndSemaphores(void);
#ifdef EXEC_BACKEND
extern void AttachSharedMemoryStructs(void);