From e452019d8e29eb52dd755ba307b96a42f89da550 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Mon, 31 Mar 2014 14:32:12 -0400 Subject: [PATCH] Mark FastPathStrongRelationLocks volatile. Otherwise, the compiler might decide to move modifications to data within this structure outside the enclosing SpinLockAcquire / SpinLockRelease pair, leading to shared memory corruption. This may or may not explain a recent lmgr-related buildfarm failure on prairiedog, but it needs to be fixed either way. --- src/backend/storage/lmgr/lock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/storage/lmgr/lock.c b/src/backend/storage/lmgr/lock.c index 3e76102794..0f21828009 100644 --- a/src/backend/storage/lmgr/lock.c +++ b/src/backend/storage/lmgr/lock.c @@ -238,7 +238,7 @@ typedef struct uint32 count[FAST_PATH_STRONG_LOCK_HASH_PARTITIONS]; } FastPathStrongRelationLockData; -FastPathStrongRelationLockData *FastPathStrongRelationLocks; +volatile FastPathStrongRelationLockData *FastPathStrongRelationLocks; /* -- 2.40.0