mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
Use latch instead of select() in walreceiver
Replace use of poll()/select() by WaitLatchOrSocket(), which is more portable and flexible. Also change walreceiver to use its procLatch instead of a custom latch. From: Petr Jelinek <petr@2ndquadrant.com>
This commit is contained in:
@ -64,7 +64,7 @@ WalRcvShmemInit(void)
|
||||
MemSet(WalRcv, 0, WalRcvShmemSize());
|
||||
WalRcv->walRcvState = WALRCV_STOPPED;
|
||||
SpinLockInit(&WalRcv->mutex);
|
||||
InitSharedLatch(&WalRcv->latch);
|
||||
WalRcv->latch = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@ -279,8 +279,8 @@ RequestXLogStreaming(TimeLineID tli, XLogRecPtr recptr, const char *conninfo,
|
||||
|
||||
if (launch)
|
||||
SendPostmasterSignal(PMSIGNAL_START_WALRECEIVER);
|
||||
else
|
||||
SetLatch(&walrcv->latch);
|
||||
else if (walrcv->latch)
|
||||
SetLatch(walrcv->latch);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user