mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-01 13:11:22 +02:00
Fix another recently-changed place that was messing with spinlock-
protected data structures and not using a volatile pointer for same.
This commit is contained in:
parent
07eeb9d109
commit
fa72121594
@ -15,7 +15,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/storage/lmgr/lwlock.c,v 1.32 2005/10/07 21:42:38 tgl Exp $
|
* $PostgreSQL: pgsql/src/backend/storage/lmgr/lwlock.c,v 1.33 2005/10/12 16:55:59 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -226,7 +226,8 @@ LWLockId
|
|||||||
LWLockAssign(void)
|
LWLockAssign(void)
|
||||||
{
|
{
|
||||||
LWLockId result;
|
LWLockId result;
|
||||||
int *LWLockCounter;
|
/* use volatile pointer to prevent code rearrangement */
|
||||||
|
volatile int *LWLockCounter;
|
||||||
|
|
||||||
LWLockCounter = (int *) ((char *) LWLockArray - 2 * sizeof(int));
|
LWLockCounter = (int *) ((char *) LWLockArray - 2 * sizeof(int));
|
||||||
SpinLockAcquire(ShmemLock);
|
SpinLockAcquire(ShmemLock);
|
||||||
|
Loading…
Reference in New Issue
Block a user