aboutsummaryrefslogtreecommitdiff
path: root/src/backend/libpq/pqmq.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/libpq/pqmq.c')
-rw-r--r--src/backend/libpq/pqmq.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/backend/libpq/pqmq.c b/src/backend/libpq/pqmq.c
index 8fbc03819d9..e1a24b62c8f 100644
--- a/src/backend/libpq/pqmq.c
+++ b/src/backend/libpq/pqmq.c
@@ -21,7 +21,6 @@
#include "tcop/tcopprot.h"
#include "utils/builtins.h"
-static shm_mq *pq_mq;
static shm_mq_handle *pq_mq_handle;
static bool pq_mq_busy = false;
static pid_t pq_mq_parallel_master_pid = 0;
@@ -56,7 +55,6 @@ void
pq_redirect_to_shm_mq(dsm_segment *seg, shm_mq_handle *mqh)
{
PqCommMethods = &PqCommMqMethods;
- pq_mq = shm_mq_get_queue(mqh);
pq_mq_handle = mqh;
whereToSendOutput = DestRemote;
FrontendProtocol = PG_PROTOCOL_LATEST;
@@ -70,7 +68,6 @@ pq_redirect_to_shm_mq(dsm_segment *seg, shm_mq_handle *mqh)
static void
pq_cleanup_redirect_to_shm_mq(dsm_segment *seg, Datum arg)
{
- pq_mq = NULL;
pq_mq_handle = NULL;
whereToSendOutput = DestNone;
}
@@ -135,9 +132,8 @@ mq_putmessage(char msgtype, const char *s, size_t len)
*/
if (pq_mq_busy)
{
- if (pq_mq != NULL)
- shm_mq_detach(pq_mq);
- pq_mq = NULL;
+ if (pq_mq_handle != NULL)
+ shm_mq_detach(pq_mq_handle);
pq_mq_handle = NULL;
return EOF;
}
@@ -148,7 +144,7 @@ mq_putmessage(char msgtype, const char *s, size_t len)
* be generated late in the shutdown sequence, after all DSMs have already
* been detached.
*/
- if (pq_mq == NULL)
+ if (pq_mq_handle == NULL)
return 0;
pq_mq_busy = true;