@@ -146,15 +146,15 @@ static shm_mq_result shm_mq_send_bytes(shm_mq_handle *mq, Size nbytes,
146146const void * data ,bool nowait ,Size * bytes_written );
147147static shm_mq_result shm_mq_receive_bytes (shm_mq * mq ,Size bytes_needed ,
148148bool nowait ,Size * nbytesp ,void * * datap );
149- static bool shm_mq_counterparty_gone (volatile shm_mq * mq ,
149+ static bool shm_mq_counterparty_gone (shm_mq * mq ,
150150BackgroundWorkerHandle * handle );
151- static bool shm_mq_wait_internal (volatile shm_mq * mq ,PGPROC * volatile * ptr ,
151+ static bool shm_mq_wait_internal (shm_mq * mq ,PGPROC * * ptr ,
152152BackgroundWorkerHandle * handle );
153- static uint64 shm_mq_get_bytes_read (volatile shm_mq * mq ,bool * detached );
154- static void shm_mq_inc_bytes_read (volatile shm_mq * mq ,Size n );
155- static uint64 shm_mq_get_bytes_written (volatile shm_mq * mq ,bool * detached );
156- static void shm_mq_inc_bytes_written (volatile shm_mq * mq ,Size n );
157- static shm_mq_result shm_mq_notify_receiver (volatile shm_mq * mq );
153+ static uint64 shm_mq_get_bytes_read (shm_mq * mq ,bool * detached );
154+ static void shm_mq_inc_bytes_read (shm_mq * mq ,Size n );
155+ static uint64 shm_mq_get_bytes_written (shm_mq * mq ,bool * detached );
156+ static void shm_mq_inc_bytes_written (shm_mq * mq ,Size n );
157+ static shm_mq_result shm_mq_notify_receiver (shm_mq * mq );
158158static void shm_mq_detach_callback (dsm_segment * seg ,Datum arg );
159159
160160/* Minimum queue size is enough for header and at least one chunk of data. */
@@ -198,13 +198,12 @@ shm_mq_create(void *address, Size size)
198198void
199199shm_mq_set_receiver (shm_mq * mq ,PGPROC * proc )
200200{
201- volatile shm_mq * vmq = mq ;
202201PGPROC * sender ;
203202
204203SpinLockAcquire (& mq -> mq_mutex );
205- Assert (vmq -> mq_receiver == NULL );
206- vmq -> mq_receiver = proc ;
207- sender = vmq -> mq_sender ;
204+ Assert (mq -> mq_receiver == NULL );
205+ mq -> mq_receiver = proc ;
206+ sender = mq -> mq_sender ;
208207SpinLockRelease (& mq -> mq_mutex );
209208
210209if (sender != NULL )
@@ -217,13 +216,12 @@ shm_mq_set_receiver(shm_mq *mq, PGPROC *proc)
217216void
218217shm_mq_set_sender (shm_mq * mq ,PGPROC * proc )
219218{
220- volatile shm_mq * vmq = mq ;
221219PGPROC * receiver ;
222220
223221SpinLockAcquire (& mq -> mq_mutex );
224- Assert (vmq -> mq_sender == NULL );
225- vmq -> mq_sender = proc ;
226- receiver = vmq -> mq_receiver ;
222+ Assert (mq -> mq_sender == NULL );
223+ mq -> mq_sender = proc ;
224+ receiver = mq -> mq_receiver ;
227225SpinLockRelease (& mq -> mq_mutex );
228226
229227if (receiver != NULL )
@@ -236,11 +234,10 @@ shm_mq_set_sender(shm_mq *mq, PGPROC *proc)
236234PGPROC *
237235shm_mq_get_receiver (shm_mq * mq )
238236{
239- volatile shm_mq * vmq = mq ;
240237PGPROC * receiver ;
241238
242239SpinLockAcquire (& mq -> mq_mutex );
243- receiver = vmq -> mq_receiver ;
240+ receiver = mq -> mq_receiver ;
244241SpinLockRelease (& mq -> mq_mutex );
245242
246243return receiver ;
@@ -252,11 +249,10 @@ shm_mq_get_receiver(shm_mq *mq)
252249PGPROC *
253250shm_mq_get_sender (shm_mq * mq )
254251{
255- volatile shm_mq * vmq = mq ;
256252PGPROC * sender ;
257253
258254SpinLockAcquire (& mq -> mq_mutex );
259- sender = vmq -> mq_sender ;
255+ sender = mq -> mq_sender ;
260256SpinLockRelease (& mq -> mq_mutex );
261257
262258return sender ;
@@ -806,18 +802,17 @@ shm_mq_detach(shm_mq_handle *mqh)
806802static void
807803shm_mq_detach_internal (shm_mq * mq )
808804{
809- volatile shm_mq * vmq = mq ;
810805PGPROC * victim ;
811806
812807SpinLockAcquire (& mq -> mq_mutex );
813- if (vmq -> mq_sender == MyProc )
814- victim = vmq -> mq_receiver ;
808+ if (mq -> mq_sender == MyProc )
809+ victim = mq -> mq_receiver ;
815810else
816811{
817- Assert (vmq -> mq_receiver == MyProc );
818- victim = vmq -> mq_sender ;
812+ Assert (mq -> mq_receiver == MyProc );
813+ victim = mq -> mq_sender ;
819814}
820- vmq -> mq_detached = true;
815+ mq -> mq_detached = true;
821816SpinLockRelease (& mq -> mq_mutex );
822817
823818if (victim != NULL )
@@ -1035,7 +1030,7 @@ shm_mq_receive_bytes(shm_mq *mq, Size bytes_needed, bool nowait,
10351030 * Test whether a counterparty who may not even be alive yet is definitely gone.
10361031 */
10371032static bool
1038- shm_mq_counterparty_gone (volatile shm_mq * mq ,BackgroundWorkerHandle * handle )
1033+ shm_mq_counterparty_gone (shm_mq * mq ,BackgroundWorkerHandle * handle )
10391034{
10401035bool detached ;
10411036pid_t pid ;
@@ -1082,8 +1077,7 @@ shm_mq_counterparty_gone(volatile shm_mq *mq, BackgroundWorkerHandle *handle)
10821077 * non-NULL when our counterpart attaches to the queue.
10831078 */
10841079static bool
1085- shm_mq_wait_internal (volatile shm_mq * mq ,PGPROC * volatile * ptr ,
1086- BackgroundWorkerHandle * handle )
1080+ shm_mq_wait_internal (shm_mq * mq ,PGPROC * * ptr ,BackgroundWorkerHandle * handle )
10871081{
10881082bool result = false;
10891083
@@ -1137,7 +1131,7 @@ shm_mq_wait_internal(volatile shm_mq *mq, PGPROC *volatile *ptr,
11371131 * the count of bytes read, but the sender must.
11381132 */
11391133static uint64
1140- shm_mq_get_bytes_read (volatile shm_mq * mq ,bool * detached )
1134+ shm_mq_get_bytes_read (shm_mq * mq ,bool * detached )
11411135{
11421136uint64 v ;
11431137
@@ -1153,7 +1147,7 @@ shm_mq_get_bytes_read(volatile shm_mq *mq, bool *detached)
11531147 * Increment the number of bytes read.
11541148 */
11551149static void
1156- shm_mq_inc_bytes_read (volatile shm_mq * mq ,Size n )
1150+ shm_mq_inc_bytes_read (shm_mq * mq ,Size n )
11571151{
11581152PGPROC * sender ;
11591153
@@ -1172,7 +1166,7 @@ shm_mq_inc_bytes_read(volatile shm_mq *mq, Size n)
11721166 * the count of bytes written, but the receiver must.
11731167 */
11741168static uint64
1175- shm_mq_get_bytes_written (volatile shm_mq * mq ,bool * detached )
1169+ shm_mq_get_bytes_written (shm_mq * mq ,bool * detached )
11761170{
11771171uint64 v ;
11781172
@@ -1188,7 +1182,7 @@ shm_mq_get_bytes_written(volatile shm_mq *mq, bool *detached)
11881182 * Increment the number of bytes written.
11891183 */
11901184static void
1191- shm_mq_inc_bytes_written (volatile shm_mq * mq ,Size n )
1185+ shm_mq_inc_bytes_written (shm_mq * mq ,Size n )
11921186{
11931187SpinLockAcquire (& mq -> mq_mutex );
11941188mq -> mq_bytes_written += n ;
@@ -1199,7 +1193,7 @@ shm_mq_inc_bytes_written(volatile shm_mq *mq, Size n)
11991193 * Set receiver's latch, unless queue is detached.
12001194 */
12011195static shm_mq_result
1202- shm_mq_notify_receiver (volatile shm_mq * mq )
1196+ shm_mq_notify_receiver (shm_mq * mq )
12031197{
12041198PGPROC * receiver ;
12051199bool detached ;