wc = WaitLatchOrSocket(MyLatch,
WL_LATCH_SET | WL_SOCKET_READABLE,
PQsocket(conn),
- -1L, WAIT_EXTENSION);
+ -1L, PG_WAIT_EXTENSION);
ResetLatch(MyLatch);
CHECK_FOR_INTERRUPTS();
switch (classId)
{
- case WAIT_LWLOCK_NAMED:
+ case PG_WAIT_LWLOCK_NAMED:
event_type = "LWLockNamed";
break;
- case WAIT_LWLOCK_TRANCHE:
+ case PG_WAIT_LWLOCK_TRANCHE:
event_type = "LWLockTranche";
break;
- case WAIT_LOCK:
+ case PG_WAIT_LOCK:
event_type = "Lock";
break;
- case WAIT_BUFFER_PIN:
+ case PG_WAIT_BUFFER_PIN:
event_type = "BufferPin";
break;
- case WAIT_ACTIVITY:
+ case PG_WAIT_ACTIVITY:
event_type = "Activity";
break;
- case WAIT_CLIENT:
+ case PG_WAIT_CLIENT:
event_type = "Client";
break;
- case WAIT_EXTENSION:
+ case PG_WAIT_EXTENSION:
event_type = "Extension";
break;
- case WAIT_IPC:
+ case PG_WAIT_IPC:
event_type = "IPC";
break;
- case WAIT_TIMEOUT:
+ case PG_WAIT_TIMEOUT:
event_type = "Timeout";
break;
default:
switch (classId)
{
- case WAIT_LWLOCK_NAMED:
- case WAIT_LWLOCK_TRANCHE:
+ case PG_WAIT_LWLOCK_NAMED:
+ case PG_WAIT_LWLOCK_TRANCHE:
event_name = GetLWLockIdentifier(classId, eventId);
break;
- case WAIT_LOCK:
+ case PG_WAIT_LOCK:
event_name = GetLockNameFromTagType(eventId);
break;
- case WAIT_BUFFER_PIN:
+ case PG_WAIT_BUFFER_PIN:
event_name = "BufferPin";
break;
- case WAIT_ACTIVITY:
+ case PG_WAIT_ACTIVITY:
{
WaitEventActivity w = (WaitEventActivity) wait_event_info;
event_name = pgstat_get_wait_activity(w);
break;
}
- case WAIT_CLIENT:
+ case PG_WAIT_CLIENT:
{
WaitEventClient w = (WaitEventClient) wait_event_info;
event_name = pgstat_get_wait_client(w);
break;
}
- case WAIT_EXTENSION:
+ case PG_WAIT_EXTENSION:
event_name = "Extension";
break;
- case WAIT_IPC:
+ case PG_WAIT_IPC:
{
WaitEventIPC w = (WaitEventIPC) wait_event_info;
event_name = pgstat_get_wait_ipc(w);
break;
}
- case WAIT_TIMEOUT:
+ case PG_WAIT_TIMEOUT:
{
WaitEventTimeout w = (WaitEventTimeout) wait_event_info;
SetStartupBufferPinWaitBufId(-1);
}
else
- ProcWaitForSignal(WAIT_BUFFER_PIN);
+ ProcWaitForSignal(PG_WAIT_BUFFER_PIN);
/*
* Remove flag marking us as waiter. Normally this will not be set
}
/* Wait to be signaled by the release of the Relation Lock */
- ProcWaitForSignal(WAIT_LOCK | locktag.locktag_type);
+ ProcWaitForSignal(PG_WAIT_LOCK | locktag.locktag_type);
/*
* Clear any timeout requests established above. We assume here that the
}
/* Wait to be signaled by UnpinBuffer() */
- ProcWaitForSignal(WAIT_BUFFER_PIN);
+ ProcWaitForSignal(PG_WAIT_BUFFER_PIN);
/*
* Clear any timeout requests established above. We assume here that the
int lockId = T_ID(lock);
if (lock->tranche == 0)
- pgstat_report_wait_start(WAIT_LWLOCK_NAMED | (uint16) lockId);
+ pgstat_report_wait_start(PG_WAIT_LWLOCK_NAMED | (uint16) lockId);
else
- pgstat_report_wait_start(WAIT_LWLOCK_TRANCHE | lock->tranche);
+ pgstat_report_wait_start(PG_WAIT_LWLOCK_TRANCHE | lock->tranche);
}
/*
const char *
GetLWLockIdentifier(uint32 classId, uint16 eventId)
{
- if (classId == WAIT_LWLOCK_NAMED)
+ if (classId == PG_WAIT_LWLOCK_NAMED)
return MainLWLockNames[eventId];
- Assert(classId == WAIT_LWLOCK_TRANCHE);
+ Assert(classId == PG_WAIT_LWLOCK_TRANCHE);
/*
* It is quite possible that user has registered tranche in one of the
else
{
WaitLatch(MyLatch, WL_LATCH_SET, 0,
- WAIT_LOCK | locallock->tag.lock.locktag_type);
+ PG_WAIT_LOCK | locallock->tag.lock.locktag_type);
ResetLatch(MyLatch);
/* check for deadlocks first, as that's probably log-worthy */
if (got_deadlock_timeout)
* Wait Classes
* ----------
*/
-#define WAIT_LWLOCK_NAMED 0x01000000U
-#define WAIT_LWLOCK_TRANCHE 0x02000000U
-#define WAIT_LOCK 0x03000000U
-#define WAIT_BUFFER_PIN 0x04000000U
-#define WAIT_ACTIVITY 0x05000000U
-#define WAIT_CLIENT 0x06000000U
-#define WAIT_EXTENSION 0x07000000U
-#define WAIT_IPC 0x08000000U
-#define WAIT_TIMEOUT 0x09000000U
+#define PG_WAIT_LWLOCK_NAMED 0x01000000U
+#define PG_WAIT_LWLOCK_TRANCHE 0x02000000U
+#define PG_WAIT_LOCK 0x03000000U
+#define PG_WAIT_BUFFER_PIN 0x04000000U
+#define PG_WAIT_ACTIVITY 0x05000000U
+#define PG_WAIT_CLIENT 0x06000000U
+#define PG_WAIT_EXTENSION 0x07000000U
+#define PG_WAIT_IPC 0x08000000U
+#define PG_WAIT_TIMEOUT 0x09000000U
/* ----------
* Wait Events - Activity
*/
typedef enum
{
- WAIT_EVENT_ARCHIVER_MAIN = WAIT_ACTIVITY,
+ WAIT_EVENT_ARCHIVER_MAIN = PG_WAIT_ACTIVITY,
WAIT_EVENT_AUTOVACUUM_MAIN,
WAIT_EVENT_BGWRITER_HIBERNATE,
WAIT_EVENT_BGWRITER_MAIN,
*/
typedef enum
{
- WAIT_EVENT_CLIENT_READ = WAIT_CLIENT,
+ WAIT_EVENT_CLIENT_READ = PG_WAIT_CLIENT,
WAIT_EVENT_CLIENT_WRITE,
WAIT_EVENT_SSL_OPEN_SERVER,
WAIT_EVENT_WAL_RECEIVER_WAIT_START,
*/
typedef enum
{
- WAIT_EVENT_BGWORKER_SHUTDOWN = WAIT_IPC,
+ WAIT_EVENT_BGWORKER_SHUTDOWN = PG_WAIT_IPC,
WAIT_EVENT_BGWORKER_STARTUP,
WAIT_EVENT_EXECUTE_GATHER,
WAIT_EVENT_MQ_INTERNAL,
*/
typedef enum
{
- WAIT_EVENT_BASE_BACKUP_THROTTLE = WAIT_TIMEOUT,
+ WAIT_EVENT_BASE_BACKUP_THROTTLE = PG_WAIT_TIMEOUT,
WAIT_EVENT_PG_SLEEP,
WAIT_EVENT_RECOVERY_APPLY_DELAY
} WaitEventTimeout;
}
/* Wait to be signalled. */
- WaitLatch(MyLatch, WL_LATCH_SET, 0, WAIT_EXTENSION);
+ WaitLatch(MyLatch, WL_LATCH_SET, 0, PG_WAIT_EXTENSION);
/* Reset the latch so we don't spin. */
ResetLatch(MyLatch);
* have read or written data and therefore there may now be work
* for us to do.
*/
- WaitLatch(MyLatch, WL_LATCH_SET, 0, WAIT_EXTENSION);
+ WaitLatch(MyLatch, WL_LATCH_SET, 0, PG_WAIT_EXTENSION);
ResetLatch(MyLatch);
CHECK_FOR_INTERRUPTS();
}
rc = WaitLatch(MyLatch,
WL_LATCH_SET | WL_TIMEOUT | WL_POSTMASTER_DEATH,
worker_spi_naptime * 1000L,
- WAIT_EXTENSION);
+ PG_WAIT_EXTENSION);
ResetLatch(MyLatch);
/* emergency bailout if postmaster has died */