Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e452019

Browse files
committed
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.
1 parent ac2063a commit e452019

File tree

1 file changed

+1
-1
lines changed
  • src/backend/storage/lmgr

1 file changed

+1
-1
lines changed

src/backend/storage/lmgr/lock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ typedef struct
238238
uint32 count[FAST_PATH_STRONG_LOCK_HASH_PARTITIONS];
239239
} FastPathStrongRelationLockData;
240240

241-
FastPathStrongRelationLockData *FastPathStrongRelationLocks;
241+
volatile FastPathStrongRelationLockData *FastPathStrongRelationLocks;
242242

243243

244244
/*

0 commit comments

Comments
 (0)