@@ -747,10 +747,10 @@ static shm_mq_result
747747shm_mq_receive_with_timeout (shm_mq_handle * mqh ,
748748 Size * nbytesp ,
749749 void * * datap ,
750- long timeout )
750+ int64 timeout )
751751{
752752 int rc = 0 ;
753- long delay = timeout ;
753+ int64 delay = timeout ;
754754 instr_time start_time ;
755755 instr_time cur_time ;
756756
@@ -781,7 +781,7 @@ shm_mq_receive_with_timeout(shm_mq_handle *mqh,
781781 INSTR_TIME_SET_CURRENT (cur_time );
782782 INSTR_TIME_SUBTRACT (cur_time , start_time );
783783
784- delay = timeout - (long ) INSTR_TIME_GET_MILLISEC (cur_time );
784+ delay = timeout - (int64 ) INSTR_TIME_GET_MILLISEC (cur_time );
785785 if (delay <= 0 )
786786 return SHM_MQ_WOULD_BLOCK ;
787787
@@ -967,6 +967,8 @@ GetRemoteBackendQueryStates(PGPROC *leader,
967967
968968 /* initialize message queue that will transfer query states */
969969 mq = shm_mq_create (mq , QUEUE_SIZE );
970+ shm_mq_set_sender (mq , leader );
971+ shm_mq_set_receiver (mq , MyProc );
970972
971973 /*
972974 * send signal `QueryStatePollReason` to all processes and define all alive
@@ -999,8 +1001,6 @@ GetRemoteBackendQueryStates(PGPROC *leader,
9991001 }
10001002
10011003 /* extract query state from leader process */
1002- shm_mq_set_sender (mq , leader );
1003- shm_mq_set_receiver (mq , MyProc );
10041004 mqh = shm_mq_attach (mq , NULL , NULL );
10051005 mq_receive_result = shm_mq_receive (mqh , & len , (void * * ) & msg , false);
10061006 if (mq_receive_result != SHM_MQ_SUCCESS )
0 commit comments