diff options
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/modules/test_shm_mq/setup.c | 4 | ||||
| -rw-r--r-- | src/test/modules/test_shm_mq/test.c | 4 | ||||
| -rw-r--r-- | src/test/modules/test_shm_mq/worker.c | 3 | ||||
| -rw-r--r-- | src/test/modules/worker_spi/worker_spi.c | 10 |
4 files changed, 9 insertions, 12 deletions
diff --git a/src/test/modules/test_shm_mq/setup.c b/src/test/modules/test_shm_mq/setup.c index b049cff2d05..195099095de 100644 --- a/src/test/modules/test_shm_mq/setup.c +++ b/src/test/modules/test_shm_mq/setup.c @@ -285,13 +285,13 @@ wait_for_workers_to_become_ready(worker_state *wstate, } /* Wait to be signalled. */ - WaitLatch(&MyProc->procLatch, WL_LATCH_SET, 0); + WaitLatch(MyLatch, WL_LATCH_SET, 0); /* An interrupt may have occurred while we were waiting. */ CHECK_FOR_INTERRUPTS(); /* Reset the latch so we don't spin. */ - ResetLatch(&MyProc->procLatch); + ResetLatch(MyLatch); } } PG_CATCH(); diff --git a/src/test/modules/test_shm_mq/test.c b/src/test/modules/test_shm_mq/test.c index 6428fcf51c4..732376daff2 100644 --- a/src/test/modules/test_shm_mq/test.c +++ b/src/test/modules/test_shm_mq/test.c @@ -230,9 +230,9 @@ test_shm_mq_pipelined(PG_FUNCTION_ARGS) * have read or written data and therefore there may now be work * for us to do. */ - WaitLatch(&MyProc->procLatch, WL_LATCH_SET, 0); + WaitLatch(MyLatch, WL_LATCH_SET, 0); CHECK_FOR_INTERRUPTS(); - ResetLatch(&MyProc->procLatch); + ResetLatch(MyLatch); } } diff --git a/src/test/modules/test_shm_mq/worker.c b/src/test/modules/test_shm_mq/worker.c index dec058b55ea..a9d9e0e2552 100644 --- a/src/test/modules/test_shm_mq/worker.c +++ b/src/test/modules/test_shm_mq/worker.c @@ -211,8 +211,7 @@ handle_sigterm(SIGNAL_ARGS) { int save_errno = errno; - if (MyProc) - SetLatch(&MyProc->procLatch); + SetLatch(MyLatch); if (!proc_exit_inprogress) { diff --git a/src/test/modules/worker_spi/worker_spi.c b/src/test/modules/worker_spi/worker_spi.c index ac0f59c9886..94d3857364f 100644 --- a/src/test/modules/worker_spi/worker_spi.c +++ b/src/test/modules/worker_spi/worker_spi.c @@ -74,8 +74,7 @@ worker_spi_sigterm(SIGNAL_ARGS) int save_errno = errno; got_sigterm = true; - if (MyProc) - SetLatch(&MyProc->procLatch); + SetLatch(MyLatch); errno = save_errno; } @@ -91,8 +90,7 @@ worker_spi_sighup(SIGNAL_ARGS) int save_errno = errno; got_sighup = true; - if (MyProc) - SetLatch(&MyProc->procLatch); + SetLatch(MyLatch); errno = save_errno; } @@ -227,10 +225,10 @@ worker_spi_main(Datum main_arg) * necessary, but is awakened if postmaster dies. That way the * background process goes away immediately in an emergency. */ - rc = WaitLatch(&MyProc->procLatch, + rc = WaitLatch(MyLatch, WL_LATCH_SET | WL_TIMEOUT | WL_POSTMASTER_DEATH, worker_spi_naptime * 1000L); - ResetLatch(&MyProc->procLatch); + ResetLatch(MyLatch); /* emergency bailout if postmaster has died */ if (rc & WL_POSTMASTER_DEATH) |
