2323 *
2424 *
2525 * IDENTIFICATION
26- * $PostgreSQL: pgsql/src/backend/storage/ipc/procarray.c,v 1.29 2007/09/0518:10:47 tgl Exp $
26+ * $PostgreSQL: pgsql/src/backend/storage/ipc/procarray.c,v 1.30 2007/09/0521:11:19 tgl Exp $
2727 *
2828 *-------------------------------------------------------------------------
2929 */
@@ -233,7 +233,7 @@ TransactionIdIsInProgress(TransactionId xid)
233233
234234for (i = 0 ;i < arrayP -> numProcs ;i ++ )
235235{
236- PGPROC * proc = arrayP -> procs [i ];
236+ volatile PGPROC * proc = arrayP -> procs [i ];
237237
238238/* Fetch xid just once - see GetNewTransactionId */
239239TransactionId pxid = proc -> xid ;
@@ -361,7 +361,7 @@ TransactionIdIsActive(TransactionId xid)
361361
362362for (i = 0 ;i < arrayP -> numProcs ;i ++ )
363363{
364- PGPROC * proc = arrayP -> procs [i ];
364+ volatile PGPROC * proc = arrayP -> procs [i ];
365365
366366/* Fetch xid just once - see GetNewTransactionId */
367367TransactionId pxid = proc -> xid ;
@@ -434,7 +434,7 @@ GetOldestXmin(bool allDbs, bool ignoreVacuum)
434434
435435for (index = 0 ;index < arrayP -> numProcs ;index ++ )
436436{
437- PGPROC * proc = arrayP -> procs [index ];
437+ volatile PGPROC * proc = arrayP -> procs [index ];
438438
439439if (ignoreVacuum && proc -> inVacuum )
440440continue ;
@@ -613,7 +613,7 @@ GetSnapshotData(Snapshot snapshot, bool serializable)
613613 */
614614for (index = 0 ;index < arrayP -> numProcs ;index ++ )
615615{
616- PGPROC * proc = arrayP -> procs [index ];
616+ volatile PGPROC * proc = arrayP -> procs [index ];
617617TransactionId xid ;
618618
619619/* Ignore procs running LAZY VACUUM */
@@ -672,7 +672,7 @@ GetSnapshotData(Snapshot snapshot, bool serializable)
672672if (nxids > 0 )
673673{
674674memcpy (snapshot -> subxip + subcount ,
675- proc -> subxids .xids ,
675+ ( void * ) proc -> subxids .xids ,
676676nxids * sizeof (TransactionId ));
677677subcount += nxids ;
678678}
@@ -739,7 +739,7 @@ GetTransactionsInCommit(TransactionId **xids_p)
739739
740740for (index = 0 ;index < arrayP -> numProcs ;index ++ )
741741{
742- PGPROC * proc = arrayP -> procs [index ];
742+ volatile PGPROC * proc = arrayP -> procs [index ];
743743/* Fetch xid just once - see GetNewTransactionId */
744744TransactionId pxid = proc -> xid ;
745745
@@ -773,7 +773,7 @@ HaveTransactionsInCommit(TransactionId *xids, int nxids)
773773
774774for (index = 0 ;index < arrayP -> numProcs ;index ++ )
775775{
776- PGPROC * proc = arrayP -> procs [index ];
776+ volatile PGPROC * proc = arrayP -> procs [index ];
777777/* Fetch xid just once - see GetNewTransactionId */
778778TransactionId pxid = proc -> xid ;
779779
@@ -861,7 +861,7 @@ BackendXidGetPid(TransactionId xid)
861861
862862for (index = 0 ;index < arrayP -> numProcs ;index ++ )
863863{
864- PGPROC * proc = arrayP -> procs [index ];
864+ volatile PGPROC * proc = arrayP -> procs [index ];
865865
866866if (proc -> xid == xid )
867867{
@@ -909,7 +909,7 @@ GetCurrentVirtualXIDs(TransactionId limitXmin)
909909
910910for (index = 0 ;index < arrayP -> numProcs ;index ++ )
911911{
912- PGPROC * proc = arrayP -> procs [index ];
912+ volatile PGPROC * proc = arrayP -> procs [index ];
913913/* Fetch xmin just once - might change on us? */
914914TransactionId pxmin = proc -> xmin ;
915915
@@ -963,7 +963,7 @@ CountActiveBackends(void)
963963 */
964964for (index = 0 ;index < arrayP -> numProcs ;index ++ )
965965{
966- PGPROC * proc = arrayP -> procs [index ];
966+ volatile PGPROC * proc = arrayP -> procs [index ];
967967
968968if (proc == MyProc )
969969continue ;/* do not count myself */
@@ -993,7 +993,7 @@ CountDBBackends(Oid databaseid)
993993
994994for (index = 0 ;index < arrayP -> numProcs ;index ++ )
995995{
996- PGPROC * proc = arrayP -> procs [index ];
996+ volatile PGPROC * proc = arrayP -> procs [index ];
997997
998998if (proc -> pid == 0 )
999999continue ;/* do not count prepared xacts */
@@ -1020,7 +1020,7 @@ CountUserBackends(Oid roleid)
10201020
10211021for (index = 0 ;index < arrayP -> numProcs ;index ++ )
10221022{
1023- PGPROC * proc = arrayP -> procs [index ];
1023+ volatile PGPROC * proc = arrayP -> procs [index ];
10241024
10251025if (proc -> pid == 0 )
10261026continue ;/* do not count prepared xacts */
@@ -1072,7 +1072,7 @@ CheckOtherDBBackends(Oid databaseId)
10721072
10731073for (index = 0 ;index < arrayP -> numProcs ;index ++ )
10741074{
1075- PGPROC * proc = arrayP -> procs [index ];
1075+ volatile PGPROC * proc = arrayP -> procs [index ];
10761076
10771077if (proc -> databaseId != databaseId )
10781078continue ;