Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit fa72121

Browse files
committed
Fix another recently-changed place that was messing with spinlock-
protected data structures and not using a volatile pointer for same.
1 parent 07eeb9d commit fa72121

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/backend/storage/lmgr/lwlock.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* Portions Copyright (c) 1994, Regents of the University of California
1616
*
1717
* IDENTIFICATION
18-
* $PostgreSQL: pgsql/src/backend/storage/lmgr/lwlock.c,v 1.32 2005/10/07 21:42:38 tgl Exp $
18+
* $PostgreSQL: pgsql/src/backend/storage/lmgr/lwlock.c,v 1.33 2005/10/12 16:55:59 tgl Exp $
1919
*
2020
*-------------------------------------------------------------------------
2121
*/
@@ -226,7 +226,8 @@ LWLockId
226226
LWLockAssign(void)
227227
{
228228
LWLockId result;
229-
int *LWLockCounter;
229+
/* use volatile pointer to prevent code rearrangement */
230+
volatile int *LWLockCounter;
230231

231232
LWLockCounter = (int *) ((char *) LWLockArray - 2 * sizeof(int));
232233
SpinLockAcquire(ShmemLock);

0 commit comments

Comments
 (0)