@@ -259,13 +259,24 @@ typedef struct BackgroundWorker
259
259
<function>WaitForBackgroundWorkerStartup(<parameter>BackgroundWorkerHandle
260
260
*handle</parameter>, <parameter>pid_t *</parameter>)</function> function.
261
261
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
264
264
the PID will be written to the provided address. Otherwise, the return
265
265
value will be <literal>BGWH_STOPPED</literal> or
266
266
<literal>BGWH_POSTMASTER_DIED</literal>.
267
267
</para>
268
268
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
+
269
280
<para>
270
281
If a background worker sends asynchronous notifications with the
271
282
<command>NOTIFY</command> command via the Server Programming Interface
0 commit comments