Add PG_WAIT_EXTENSION to WaitLatchOrSocket calls

WaitLatchOrSocket now accepts a "wait_event_info" argument for use by
pg_stat. Extensions appear to mostly just pass "PG_WAIT_EXTENSION", so
that's what I've done.
pull/1439/head
Jason Petersen 2017-04-19 13:50:54 -06:00
parent 603b9cf3c4
commit 4610978c10
No known key found for this signature in database
GPG Key ID: 9F1D3510D110ABA9
1 changed files with 11 additions and 0 deletions

View File

@ -9,6 +9,7 @@
*/
#include "postgres.h"
#include "pgstat.h"
#include "libpq-fe.h"
@ -434,7 +435,12 @@ GetRemoteCommandResult(MultiConnection *connection, bool raiseInterrupts)
/* this means we have to wait for data to go out */
Assert(rc == 1);
#if (PG_VERSION_NUM >= 100000)
rc = WaitLatchOrSocket(MyLatch, waitFlags | WL_SOCKET_WRITEABLE, socket, 0,
PG_WAIT_EXTENSION);
#else
rc = WaitLatchOrSocket(MyLatch, waitFlags | WL_SOCKET_WRITEABLE, socket, 0);
#endif
if (rc & WL_POSTMASTER_DEATH)
{
@ -484,7 +490,12 @@ GetRemoteCommandResult(MultiConnection *connection, bool raiseInterrupts)
break;
}
#if (PG_VERSION_NUM >= 100000)
rc = WaitLatchOrSocket(MyLatch, waitFlags | WL_SOCKET_READABLE, socket, 0,
PG_WAIT_EXTENSION);
#else
rc = WaitLatchOrSocket(MyLatch, waitFlags | WL_SOCKET_READABLE, socket, 0);
#endif
if (rc & WL_POSTMASTER_DEATH)
{