diff options
author | Michael Paquier <michael@paquier.xyz> | 2023-07-03 11:01:02 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2023-07-03 11:01:02 +0900 |
commit | 2aeaf80e578ed48af88d54caf2ffcf7ca62617e8 (patch) | |
tree | a322df445b8663e7e6dbbaa970ae856d40d36902 /src/include | |
parent | 8c12838001c2d974d3608fe55c228f601818a729 (diff) |
Refactor some code related to wait events "BufferPin" and "Extension"
The following changes are done:
- Addition of WaitEventBufferPin and WaitEventExtension, that hold a
list of wait events related to each category.
- Addition of two functions that encapsulate the list of wait events for
each category.
- Rename BUFFER_PIN to BUFFERPIN (only this wait event class used an
underscore, requiring a specific rule in the automation script).
These changes make a bit easier the automatic generation of all the code
and documentation related to wait events, as all the wait event
categories are now controlled by consistent structures and functions.
Author: Bertrand Drouvot
Discussion: https://postgr.es/m/c6f35117-4b20-4c78-1df5-d3056010dcf5@gmail.com
Discussion: https://postgr.es/m/77a86b3a-c4a8-5f5d-69b9-d70bbf2e9b98@gmail.com
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/utils/wait_event.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/include/utils/wait_event.h b/src/include/utils/wait_event.h index 518d3b0a1f7..dc01d4e84df 100644 --- a/src/include/utils/wait_event.h +++ b/src/include/utils/wait_event.h @@ -17,7 +17,7 @@ */ #define PG_WAIT_LWLOCK 0x01000000U #define PG_WAIT_LOCK 0x03000000U -#define PG_WAIT_BUFFER_PIN 0x04000000U +#define PG_WAIT_BUFFERPIN 0x04000000U #define PG_WAIT_ACTIVITY 0x05000000U #define PG_WAIT_CLIENT 0x06000000U #define PG_WAIT_EXTENSION 0x07000000U @@ -51,6 +51,15 @@ typedef enum } WaitEventActivity; /* ---------- + * Wait Events - BUFFERPIN + * ---------- + */ +typedef enum +{ + WAIT_EVENT_BUFFER_PIN = PG_WAIT_BUFFERPIN +} WaitEventBufferPin; + +/* ---------- * Wait Events - Client * * Use this category when a process is waiting to send data to or receive data @@ -71,6 +80,15 @@ typedef enum } WaitEventClient; /* ---------- + * Wait Events - EXTENSION + * ---------- + */ +typedef enum +{ + WAIT_EVENT_EXTENSION = PG_WAIT_EXTENSION +} WaitEventExtension; + +/* ---------- * Wait Events - IPC * * Use this category when a process cannot complete the work it is doing because |