Skip to content

Commit a886090

Browse files
committed
doc: Add WaitForBackgroundWorkerShutdown() to bgw docs.
Commit 924bcf4 added WaitForBackgroundWorkerShutdown, but didn't add it to the documentation. Fix that and two small spelling errors in the WaitForBackgroundWorkerStartup paragraph. Author: Daniel Gustafsson Discussion: https://postgr.es/m/C8738949-0350-4999-A1DA-26E209FF248D@yesql.se
1 parent 8c438fc commit a886090

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

doc/src/sgml/bgworker.sgml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,24 @@ typedef struct BackgroundWorker
259259
<function>WaitForBackgroundWorkerStartup(<parameter>BackgroundWorkerHandle
260260
*handle</parameter>, <parameter>pid_t *</parameter>)</function> function.
261261
This function will block until the postmaster has attempted to start the
262-
background worker, or until the postmaster dies. If the background runner
263-
is running, the return value will <literal>BGWH_STARTED</literal>, and
262+
background worker, or until the postmaster dies. If the background worker
263+
is running, the return value will be <literal>BGWH_STARTED</literal>, and
264264
the PID will be written to the provided address. Otherwise, the return
265265
value will be <literal>BGWH_STOPPED</literal> or
266266
<literal>BGWH_POSTMASTER_DIED</literal>.
267267
</para>
268268

269+
<para>
270+
A process can also wait for a background worker to shut down, by using the
271+
<function>WaitForBackgroundWorkerShutdown(<parameter>BackgroundWorkerHandle
272+
*handle</parameter>)</function> function and passing the
273+
<type>BackgroundWorkerHandle *</type> obtained at registration. This
274+
function will block until the background worker exits, or postmaster dies.
275+
When the background worker exits, the return value is
276+
<literal>BGWH_STOPPED</literal>, if postmaster dies it will return
277+
<literal>BGWH_POSTMASTER_DIED</literal>.
278+
</para>
279+
269280
<para>
270281
If a background worker sends asynchronous notifications with the
271282
<command>NOTIFY</command> command via the Server Programming Interface

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