volatile test_shm_mq_header *hdr);
static bool check_worker_status(worker_state *wstate);
+/* value cached, fetched from shared memory */
+static uint32 we_bgworker_startup = 0;
+
/*
* Set up a dynamic shared memory segment and zero or more background workers
* for a test run.
break;
}
+ /* first time, allocate or get the custom wait event */
+ if (we_bgworker_startup == 0)
+ we_bgworker_startup = WaitEventExtensionNew("TestShmMqBgWorkerStartup");
+
/* Wait to be signaled. */
(void) WaitLatch(MyLatch, WL_LATCH_SET | WL_EXIT_ON_PM_DEATH, 0,
- WAIT_EVENT_EXTENSION);
+ we_bgworker_startup);
/* Reset the latch so we don't spin. */
ResetLatch(MyLatch);
static void verify_message(Size origlen, char *origdata, Size newlen,
char *newdata);
+/* value cached, fetched from shared memory */
+static uint32 we_message_queue = 0;
+
/*
* Simple test of the shared memory message queue infrastructure.
*
if (wait)
{
+ /* first time, allocate or get the custom wait event */
+ if (we_message_queue == 0)
+ we_message_queue = WaitEventExtensionNew("TestShmMqMessageQueue");
+
/*
* If we made no progress, wait for one of the other processes to
* which we are connected to set our latch, indicating that they
* for us to do.
*/
(void) WaitLatch(MyLatch, WL_LATCH_SET | WL_EXIT_ON_PM_DEATH, 0,
- WAIT_EVENT_EXTENSION);
+ we_message_queue);
ResetLatch(MyLatch);
CHECK_FOR_INTERRUPTS();
}