@@ -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