diff options
author | Robert Haas <rhaas@postgresql.org> | 2015-10-06 15:45:02 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2015-10-06 15:45:02 -0400 |
commit | 8f6bb851bdb75d741b3a7543bbf681e3cd7e65dc (patch) | |
tree | 676d9f4141dfe2896a1ead18475529ac64172144 /src/backend/replication/walreceiver.c | |
parent | b943f502b788a3708ca660785fd14a4ee938fdcd (diff) |
Remove more volatile qualifiers.
Prior to commit 0709b7ee72e4bc71ad07b7120acd117265ab51d0, access to
variables within a spinlock-protected critical section had to be done
through a volatile pointer, but that should no longer be necessary.
This continues work begun in df4077cda2eae3eb4a5cf387da0c1e7616e73204
and 6ba4ecbf477e0b25dd7bde1b0c4e07fc2da19348.
Thomas Munro and Michael Paquier
Diffstat (limited to 'src/backend/replication/walreceiver.c')
-rw-r--r-- | src/backend/replication/walreceiver.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/backend/replication/walreceiver.c b/src/backend/replication/walreceiver.c index 41e57f24397..183a3a553db 100644 --- a/src/backend/replication/walreceiver.c +++ b/src/backend/replication/walreceiver.c @@ -192,9 +192,7 @@ WalReceiverMain(void) TimeLineID startpointTLI; TimeLineID primaryTLI; bool first_stream; - - /* use volatile pointer to prevent code rearrangement */ - volatile WalRcvData *walrcv = WalRcv; + WalRcvData *walrcv = WalRcv; TimestampTz last_recv_timestamp; bool ping_sent; @@ -559,8 +557,7 @@ WalReceiverMain(void) static void WalRcvWaitForStartPosition(XLogRecPtr *startpoint, TimeLineID *startpointTLI) { - /* use volatile pointer to prevent code rearrangement */ - volatile WalRcvData *walrcv = WalRcv; + WalRcvData *walrcv = WalRcv; int state; SpinLockAcquire(&walrcv->mutex); @@ -693,8 +690,7 @@ WalRcvFetchTimeLineHistoryFiles(TimeLineID first, TimeLineID last) static void WalRcvDie(int code, Datum arg) { - /* use volatile pointer to prevent code rearrangement */ - volatile WalRcvData *walrcv = WalRcv; + WalRcvData *walrcv = WalRcv; /* Ensure that all WAL records received are flushed to disk */ XLogWalRcvFlush(true); @@ -974,8 +970,7 @@ XLogWalRcvFlush(bool dying) { if (LogstreamResult.Flush < LogstreamResult.Write) { - /* use volatile pointer to prevent code rearrangement */ - volatile WalRcvData *walrcv = WalRcv; + WalRcvData *walrcv = WalRcv; issue_xlog_fsync(recvFile, recvSegNo); @@ -1179,8 +1174,7 @@ XLogWalRcvSendHSFeedback(bool immed) static void ProcessWalSndrMessage(XLogRecPtr walEnd, TimestampTz sendTime) { - /* use volatile pointer to prevent code rearrangement */ - volatile WalRcvData *walrcv = WalRcv; + WalRcvData *walrcv = WalRcv; TimestampTz lastMsgReceiptTime = GetCurrentTimestamp(); |