Skip to content

Commit d2ce38e

Browse files
committed
Rename WAIT_* constants to PG_WAIT_*.
Windows apparently has a constant named WAIT_TIMEOUT, and some of these other names are pretty generic, too. Insert "PG_" at the front of each name in order to disambiguate. Michael Paquier
1 parent eda0488 commit d2ce38e

File tree

10 files changed

+43
-43
lines changed

10 files changed

+43
-43
lines changed

contrib/postgres_fdw/connection.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ pgfdw_get_result(PGconn *conn, const char *query)
497497
wc = WaitLatchOrSocket(MyLatch,
498498
WL_LATCH_SET | WL_SOCKET_READABLE,
499499
PQsocket(conn),
500-
-1L, WAIT_EXTENSION);
500+
-1L, PG_WAIT_EXTENSION);
501501
ResetLatch(MyLatch);
502502

503503
CHECK_FOR_INTERRUPTS();

src/backend/postmaster/pgstat.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3147,31 +3147,31 @@ pgstat_get_wait_event_type(uint32 wait_event_info)
31473147

31483148
switch (classId)
31493149
{
3150-
case WAIT_LWLOCK_NAMED:
3150+
case PG_WAIT_LWLOCK_NAMED:
31513151
event_type = "LWLockNamed";
31523152
break;
3153-
case WAIT_LWLOCK_TRANCHE:
3153+
case PG_WAIT_LWLOCK_TRANCHE:
31543154
event_type = "LWLockTranche";
31553155
break;
3156-
case WAIT_LOCK:
3156+
case PG_WAIT_LOCK:
31573157
event_type = "Lock";
31583158
break;
3159-
case WAIT_BUFFER_PIN:
3159+
case PG_WAIT_BUFFER_PIN:
31603160
event_type = "BufferPin";
31613161
break;
3162-
case WAIT_ACTIVITY:
3162+
case PG_WAIT_ACTIVITY:
31633163
event_type = "Activity";
31643164
break;
3165-
case WAIT_CLIENT:
3165+
case PG_WAIT_CLIENT:
31663166
event_type = "Client";
31673167
break;
3168-
case WAIT_EXTENSION:
3168+
case PG_WAIT_EXTENSION:
31693169
event_type = "Extension";
31703170
break;
3171-
case WAIT_IPC:
3171+
case PG_WAIT_IPC:
31723172
event_type = "IPC";
31733173
break;
3174-
case WAIT_TIMEOUT:
3174+
case PG_WAIT_TIMEOUT:
31753175
event_type = "Timeout";
31763176
break;
31773177
default:
@@ -3204,41 +3204,41 @@ pgstat_get_wait_event(uint32 wait_event_info)
32043204

32053205
switch (classId)
32063206
{
3207-
case WAIT_LWLOCK_NAMED:
3208-
case WAIT_LWLOCK_TRANCHE:
3207+
case PG_WAIT_LWLOCK_NAMED:
3208+
case PG_WAIT_LWLOCK_TRANCHE:
32093209
event_name = GetLWLockIdentifier(classId, eventId);
32103210
break;
3211-
case WAIT_LOCK:
3211+
case PG_WAIT_LOCK:
32123212
event_name = GetLockNameFromTagType(eventId);
32133213
break;
3214-
case WAIT_BUFFER_PIN:
3214+
case PG_WAIT_BUFFER_PIN:
32153215
event_name = "BufferPin";
32163216
break;
3217-
case WAIT_ACTIVITY:
3217+
case PG_WAIT_ACTIVITY:
32183218
{
32193219
WaitEventActivity w = (WaitEventActivity) wait_event_info;
32203220

32213221
event_name = pgstat_get_wait_activity(w);
32223222
break;
32233223
}
3224-
case WAIT_CLIENT:
3224+
case PG_WAIT_CLIENT:
32253225
{
32263226
WaitEventClient w = (WaitEventClient) wait_event_info;
32273227

32283228
event_name = pgstat_get_wait_client(w);
32293229
break;
32303230
}
3231-
case WAIT_EXTENSION:
3231+
case PG_WAIT_EXTENSION:
32323232
event_name = "Extension";
32333233
break;
3234-
case WAIT_IPC:
3234+
case PG_WAIT_IPC:
32353235
{
32363236
WaitEventIPC w = (WaitEventIPC) wait_event_info;
32373237

32383238
event_name = pgstat_get_wait_ipc(w);
32393239
break;
32403240
}
3241-
case WAIT_TIMEOUT:
3241+
case PG_WAIT_TIMEOUT:
32423242
{
32433243
WaitEventTimeout w = (WaitEventTimeout) wait_event_info;
32443244

src/backend/storage/buffer/bufmgr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3646,7 +3646,7 @@ LockBufferForCleanup(Buffer buffer)
36463646
SetStartupBufferPinWaitBufId(-1);
36473647
}
36483648
else
3649-
ProcWaitForSignal(WAIT_BUFFER_PIN);
3649+
ProcWaitForSignal(PG_WAIT_BUFFER_PIN);
36503650

36513651
/*
36523652
* Remove flag marking us as waiter. Normally this will not be set

src/backend/storage/ipc/standby.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ ResolveRecoveryConflictWithLock(LOCKTAG locktag)
390390
}
391391

392392
/* Wait to be signaled by the release of the Relation Lock */
393-
ProcWaitForSignal(WAIT_LOCK | locktag.locktag_type);
393+
ProcWaitForSignal(PG_WAIT_LOCK | locktag.locktag_type);
394394

395395
/*
396396
* Clear any timeout requests established above. We assume here that the
@@ -470,7 +470,7 @@ ResolveRecoveryConflictWithBufferPin(void)
470470
}
471471

472472
/* Wait to be signaled by UnpinBuffer() */
473-
ProcWaitForSignal(WAIT_BUFFER_PIN);
473+
ProcWaitForSignal(PG_WAIT_BUFFER_PIN);
474474

475475
/*
476476
* Clear any timeout requests established above. We assume here that the

src/backend/storage/lmgr/lwlock.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -732,9 +732,9 @@ LWLockReportWaitStart(LWLock *lock)
732732
int lockId = T_ID(lock);
733733

734734
if (lock->tranche == 0)
735-
pgstat_report_wait_start(WAIT_LWLOCK_NAMED | (uint16) lockId);
735+
pgstat_report_wait_start(PG_WAIT_LWLOCK_NAMED | (uint16) lockId);
736736
else
737-
pgstat_report_wait_start(WAIT_LWLOCK_TRANCHE | lock->tranche);
737+
pgstat_report_wait_start(PG_WAIT_LWLOCK_TRANCHE | lock->tranche);
738738
}
739739

740740
/*
@@ -752,10 +752,10 @@ LWLockReportWaitEnd(void)
752752
const char *
753753
GetLWLockIdentifier(uint32 classId, uint16 eventId)
754754
{
755-
if (classId == WAIT_LWLOCK_NAMED)
755+
if (classId == PG_WAIT_LWLOCK_NAMED)
756756
return MainLWLockNames[eventId];
757757

758-
Assert(classId == WAIT_LWLOCK_TRANCHE);
758+
Assert(classId == PG_WAIT_LWLOCK_TRANCHE);
759759

760760
/*
761761
* It is quite possible that user has registered tranche in one of the

src/backend/storage/lmgr/proc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1214,7 +1214,7 @@ ProcSleep(LOCALLOCK *locallock, LockMethod lockMethodTable)
12141214
else
12151215
{
12161216
WaitLatch(MyLatch, WL_LATCH_SET, 0,
1217-
WAIT_LOCK | locallock->tag.lock.locktag_type);
1217+
PG_WAIT_LOCK | locallock->tag.lock.locktag_type);
12181218
ResetLatch(MyLatch);
12191219
/* check for deadlocks first, as that's probably log-worthy */
12201220
if (got_deadlock_timeout)

src/include/pgstat.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -715,15 +715,15 @@ typedef enum BackendState
715715
* Wait Classes
716716
* ----------
717717
*/
718-
#define WAIT_LWLOCK_NAMED 0x01000000U
719-
#define WAIT_LWLOCK_TRANCHE 0x02000000U
720-
#define WAIT_LOCK 0x03000000U
721-
#define WAIT_BUFFER_PIN 0x04000000U
722-
#define WAIT_ACTIVITY 0x05000000U
723-
#define WAIT_CLIENT 0x06000000U
724-
#define WAIT_EXTENSION 0x07000000U
725-
#define WAIT_IPC 0x08000000U
726-
#define WAIT_TIMEOUT 0x09000000U
718+
#define PG_WAIT_LWLOCK_NAMED 0x01000000U
719+
#define PG_WAIT_LWLOCK_TRANCHE 0x02000000U
720+
#define PG_WAIT_LOCK 0x03000000U
721+
#define PG_WAIT_BUFFER_PIN 0x04000000U
722+
#define PG_WAIT_ACTIVITY 0x05000000U
723+
#define PG_WAIT_CLIENT 0x06000000U
724+
#define PG_WAIT_EXTENSION 0x07000000U
725+
#define PG_WAIT_IPC 0x08000000U
726+
#define PG_WAIT_TIMEOUT 0x09000000U
727727

728728
/* ----------
729729
* Wait Events - Activity
@@ -735,7 +735,7 @@ typedef enum BackendState
735735
*/
736736
typedef enum
737737
{
738-
WAIT_EVENT_ARCHIVER_MAIN = WAIT_ACTIVITY,
738+
WAIT_EVENT_ARCHIVER_MAIN = PG_WAIT_ACTIVITY,
739739
WAIT_EVENT_AUTOVACUUM_MAIN,
740740
WAIT_EVENT_BGWRITER_HIBERNATE,
741741
WAIT_EVENT_BGWRITER_MAIN,
@@ -759,7 +759,7 @@ typedef enum
759759
*/
760760
typedef enum
761761
{
762-
WAIT_EVENT_CLIENT_READ = WAIT_CLIENT,
762+
WAIT_EVENT_CLIENT_READ = PG_WAIT_CLIENT,
763763
WAIT_EVENT_CLIENT_WRITE,
764764
WAIT_EVENT_SSL_OPEN_SERVER,
765765
WAIT_EVENT_WAL_RECEIVER_WAIT_START,
@@ -776,7 +776,7 @@ typedef enum
776776
*/
777777
typedef enum
778778
{
779-
WAIT_EVENT_BGWORKER_SHUTDOWN = WAIT_IPC,
779+
WAIT_EVENT_BGWORKER_SHUTDOWN = PG_WAIT_IPC,
780780
WAIT_EVENT_BGWORKER_STARTUP,
781781
WAIT_EVENT_EXECUTE_GATHER,
782782
WAIT_EVENT_MQ_INTERNAL,
@@ -796,7 +796,7 @@ typedef enum
796796
*/
797797
typedef enum
798798
{
799-
WAIT_EVENT_BASE_BACKUP_THROTTLE = WAIT_TIMEOUT,
799+
WAIT_EVENT_BASE_BACKUP_THROTTLE = PG_WAIT_TIMEOUT,
800800
WAIT_EVENT_PG_SLEEP,
801801
WAIT_EVENT_RECOVERY_APPLY_DELAY
802802
} WaitEventTimeout;

src/test/modules/test_shm_mq/setup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ wait_for_workers_to_become_ready(worker_state *wstate,
280280
}
281281

282282
/* Wait to be signalled. */
283-
WaitLatch(MyLatch, WL_LATCH_SET, 0, WAIT_EXTENSION);
283+
WaitLatch(MyLatch, WL_LATCH_SET, 0, PG_WAIT_EXTENSION);
284284

285285
/* Reset the latch so we don't spin. */
286286
ResetLatch(MyLatch);

src/test/modules/test_shm_mq/test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ test_shm_mq_pipelined(PG_FUNCTION_ARGS)
231231
* have read or written data and therefore there may now be work
232232
* for us to do.
233233
*/
234-
WaitLatch(MyLatch, WL_LATCH_SET, 0, WAIT_EXTENSION);
234+
WaitLatch(MyLatch, WL_LATCH_SET, 0, PG_WAIT_EXTENSION);
235235
ResetLatch(MyLatch);
236236
CHECK_FOR_INTERRUPTS();
237237
}

src/test/modules/worker_spi/worker_spi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ worker_spi_main(Datum main_arg)
228228
rc = WaitLatch(MyLatch,
229229
WL_LATCH_SET | WL_TIMEOUT | WL_POSTMASTER_DEATH,
230230
worker_spi_naptime * 1000L,
231-
WAIT_EXTENSION);
231+
PG_WAIT_EXTENSION);
232232
ResetLatch(MyLatch);
233233

234234
/* emergency bailout if postmaster has died */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy