aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/port/posix_sema.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/backend/port/posix_sema.c b/src/backend/port/posix_sema.c
index a2cabe58fcb..5174550794b 100644
--- a/src/backend/port/posix_sema.c
+++ b/src/backend/port/posix_sema.c
@@ -41,13 +41,19 @@
#error cannot use named POSIX semaphores with EXEC_BACKEND
#endif
+typedef union SemTPadded
+{
+ sem_t pgsem;
+ char pad[PG_CACHE_LINE_SIZE];
+} SemTPadded;
+
/* typedef PGSemaphore is equivalent to pointer to sem_t */
typedef struct PGSemaphoreData
{
- sem_t pgsem;
+ SemTPadded sem_padded;
} PGSemaphoreData;
-#define PG_SEM_REF(x) (&(x)->pgsem)
+#define PG_SEM_REF(x) (&(x)->sem_padded.pgsem)
#define IPCProtection (0600) /* access/modify by user only */