On Mon, Jul 31, 2023 at 12:58 PM Michael Paquier <mich...@paquier.xyz> wrote: > > > Attaching a v11 based on Bharath's feedback and yours, for now. I > have also applied the addition of the two masking variables in > wait_event.c separately with 7395a90.
+uint32 WaitEventExtensionNew(void) +</programlisting> + Next, each process needs to associate the wait event allocated previously + to a user-facing custom string, which is something done by calling: +<programlisting> +void WaitEventExtensionRegisterName(uint32 wait_event_info, const char *wait_event_name) +</programlisting> + An example can be found in <filename>src/test/modules/worker_spi</filename> + in the PostgreSQL source tree. + </para> Do you think it's worth adding a note here in the docs about an external module defining more than one custom wait event? A pseudo code if possible or just a note? Also, how about a XXX comment atop WaitEventExtensionNew and/or WaitEventExtensionRegisterName on the possibility of extending the functions to support allocation of more than one custom wait events? -- Bharath Rupireddy PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com