@@ -146,15 +146,15 @@ static shm_mq_result shm_mq_send_bytes(shm_mq_handle *mq, Size nbytes,
146146 const void * data , bool nowait , Size * bytes_written );
147147static shm_mq_result shm_mq_receive_bytes (shm_mq * mq , Size bytes_needed ,
148148 bool 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 ,
150150 BackgroundWorkerHandle * 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 ,
152152 BackgroundWorkerHandle * 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 ;
202201 PGPROC * sender ;
203202
204203 SpinLockAcquire (& 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 ;
208207 SpinLockRelease (& mq -> mq_mutex );
209208
210209 if (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 ;
221219 PGPROC * receiver ;
222220
223221 SpinLockAcquire (& 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 ;
227225 SpinLockRelease (& mq -> mq_mutex );
228226
229227 if (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 ;
240237 PGPROC * receiver ;
241238
242239 SpinLockAcquire (& mq -> mq_mutex );
243- receiver = vmq -> mq_receiver ;
240+ receiver = mq -> mq_receiver ;
244241 SpinLockRelease (& mq -> mq_mutex );
245242
246243 return 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 ;
256252 PGPROC * sender ;
257253
258254 SpinLockAcquire (& mq -> mq_mutex );
259- sender = vmq -> mq_sender ;
255+ sender = mq -> mq_sender ;
260256 SpinLockRelease (& mq -> mq_mutex );
261257
262258 return 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 ;
810805 PGPROC * victim ;
811806
812807 SpinLockAcquire (& 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 ;
815810 else
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;
821816 SpinLockRelease (& mq -> mq_mutex );
822817
823818 if (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{
10401035 bool detached ;
10411036 pid_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{
10881082 bool 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{
11421136 uint64 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{
11581152 PGPROC * 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{
11771171 uint64 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{
11931187 SpinLockAcquire (& mq -> mq_mutex );
11941188 mq -> 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{
12041198 PGPROC * receiver ;
12051199 bool detached ;
0 commit comments