summaryrefslogtreecommitdiff
path: root/src/include/replication
diff options
context:
space:
mode:
authorThomas Munro <tmunro@postgresql.org>2021-03-12 19:07:27 +1300
committerThomas Munro <tmunro@postgresql.org>2021-03-12 19:45:42 +1300
commitde829ddf23f69190efb4e0178704c4c4228e17cd (patch)
treedaf6a6291626971ffa700db0b2b2d1e4b457eaab /src/include/replication
parent600f2f50b7a57c8481276450c9019fa7b3656411 (diff)
Add condition variable for walreceiver shutdown.
Use this new CV to wait for walreceiver shutdown without a sleep/poll loop, while also benefiting from standard postmaster death handling. Discussion: https://postgr.es/m/CA%2BhUKGK1607VmtrDUHQXrsooU%3Dap4g4R2yaoByWOOA3m8xevUQ%40mail.gmail.com
Diffstat (limited to 'src/include/replication')
-rw-r--r--src/include/replication/walreceiver.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/include/replication/walreceiver.h b/src/include/replication/walreceiver.h
index a97a59a6a30..4fd7c25ea74 100644
--- a/src/include/replication/walreceiver.h
+++ b/src/include/replication/walreceiver.h
@@ -19,6 +19,7 @@
#include "port/atomics.h"
#include "replication/logicalproto.h"
#include "replication/walsender.h"
+#include "storage/condition_variable.h"
#include "storage/latch.h"
#include "storage/spin.h"
#include "utils/tuplestore.h"
@@ -62,6 +63,7 @@ typedef struct
*/
pid_t pid;
WalRcvState walRcvState;
+ ConditionVariable walRcvStoppedCV;
pg_time_t startTime;
/*