diff options
| author | Michael Paquier | 2024-05-17 03:29:57 +0000 |
|---|---|---|
| committer | Michael Paquier | 2024-05-17 03:29:57 +0000 |
| commit | 110eb4aefbad683c8f512ee8a7168d1718353baa (patch) | |
| tree | 0689c4fa584a2ea219803c270f251b2ae04e84c7 /src/backend | |
| parent | 372700cf3067254317e7e8060662f8fac11500d5 (diff) | |
Remove enum WaitEventExtension
This enum was used to determine the first ID to use when assigning a
custom wait event for extensions, which is always 1. It was kept so
as it would be possible to add new in-core wait events in the category
"Extension". There is no such thing currently, so let's remove this
enum until a case justifying it pops up. This makes the code simpler
and easier to understand.
This has as effect to switch back autoprewarm.c to use PG_WAIT_EXTENSION
rather than WAIT_EVENT_EXTENSION, on par with v16 and older stable
branches.
Thinko in c9af05465307.
Reported-by: Peter Eisentraut
Discussion: https://postgr.es/m/195c6c45-abce-4331-be6a-e87724e1d060@eisentraut.org
Diffstat (limited to 'src/backend')
| -rw-r--r-- | src/backend/utils/activity/wait_event.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 4ffcb10c8b5..084a9dfdc28 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -89,8 +89,7 @@ typedef struct WaitEventExtensionCounterData static WaitEventExtensionCounterData *WaitEventExtensionCounter; /* first event ID of custom wait events for extensions */ -#define NUM_BUILTIN_WAIT_EVENT_EXTENSION \ - (WAIT_EVENT_EXTENSION_FIRST_USER_DEFINED - WAIT_EVENT_EXTENSION) +#define WAIT_EVENT_EXTENSION_INITIAL_ID 1 /* wait event info for extensions */ #define WAIT_EVENT_EXTENSION_INFO(eventId) (PG_WAIT_EXTENSION | eventId) @@ -129,7 +128,7 @@ WaitEventExtensionShmemInit(void) if (!found) { /* initialize the allocation counter and its spinlock. */ - WaitEventExtensionCounter->nextId = NUM_BUILTIN_WAIT_EVENT_EXTENSION; + WaitEventExtensionCounter->nextId = WAIT_EVENT_EXTENSION_INITIAL_ID; SpinLockInit(&WaitEventExtensionCounter->mutex); } @@ -244,7 +243,7 @@ GetWaitEventExtensionIdentifier(uint16 eventId) WaitEventExtensionEntryById *entry; /* Built-in event? */ - if (eventId < NUM_BUILTIN_WAIT_EVENT_EXTENSION) + if (eventId < WAIT_EVENT_EXTENSION_INITIAL_ID) return "Extension"; /* It is a user-defined wait event, so lookup hash table. */ |
