summaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2025-11-06 12:50:10 +0200
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2025-11-06 14:20:48 +0200
commitdaf3d99d2b8bebb3361163a11ef3d232002127c9 (patch)
tree386d35c84e32bef55dbaa67bf5aeb5d13ecbb917 /src/backend
parent150e24501bc218057a7b9a24b19a145fa8b5c678 (diff)
Add comment to explain why PGReserveSemaphores() is called early
Before commit e25626677f, PGReserveSemaphores() had to be called before SpinlockSemaInit() because spinlocks were implemented using semaphores on some platforms (--disable-spinlocks). Add a comment explaining that. Author: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com> Discussion: https://www.postgresql.org/message-id/CAExHW5seSZpPx-znjidVZNzdagGHOk06F+Ds88MpPUbxd1kTaA@mail.gmail.com Backpatch-to: 18
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/storage/ipc/ipci.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/backend/storage/ipc/ipci.c b/src/backend/storage/ipc/ipci.c
index 10ffce8d174..19f9c774488 100644
--- a/src/backend/storage/ipc/ipci.c
+++ b/src/backend/storage/ipc/ipci.c
@@ -227,7 +227,9 @@ CreateSharedMemoryAndSemaphores(void)
InitShmemAccess(seghdr);
/*
- * Create semaphores
+ * Create semaphores. (This is done here for historical reasons. We used
+ * to support emulating spinlocks with semaphores, which required
+ * initializing semaphores early.)
*/
PGReserveSemaphores(numSemas);