aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2018-03-01 01:46:04 -0800
committerAndres Freund <andres@anarazel.de>2018-03-01 01:46:04 -0800
commita88609089ab84fc9f2a925bee31ec2e0c776d166 (patch)
tree17715062ddc7351c09a873fb5f0ef254a8d39cd0
parent8c438fcc9f19273b884b0c7498c74391c7546014 (diff)
downloadpostgresql-a88609089ab84fc9f2a925bee31ec2e0c776d166.tar.gz
postgresql-a88609089ab84fc9f2a925bee31ec2e0c776d166.zip
doc: Add WaitForBackgroundWorkerShutdown() to bgw docs.
Commit 924bcf4f16d 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
-rw-r--r--doc/src/sgml/bgworker.sgml15
1 files changed, 13 insertions, 2 deletions
diff --git a/doc/src/sgml/bgworker.sgml b/doc/src/sgml/bgworker.sgml
index e490bb8750e..18ad2e45771 100644
--- a/doc/src/sgml/bgworker.sgml
+++ b/doc/src/sgml/bgworker.sgml
@@ -259,14 +259,25 @@ typedef struct BackgroundWorker
<function>WaitForBackgroundWorkerStartup(<parameter>BackgroundWorkerHandle
*handle</parameter>, <parameter>pid_t *</parameter>)</function> function.
This function will block until the postmaster has attempted to start the
- background worker, or until the postmaster dies. If the background runner
- is running, the return value will <literal>BGWH_STARTED</literal>, and
+ background worker, or until the postmaster dies. If the background worker
+ is running, the return value will be <literal>BGWH_STARTED</literal>, and
the PID will be written to the provided address. Otherwise, the return
value will be <literal>BGWH_STOPPED</literal> or
<literal>BGWH_POSTMASTER_DIED</literal>.
</para>
<para>
+ A process can also wait for a background worker to shut down, by using the
+ <function>WaitForBackgroundWorkerShutdown(<parameter>BackgroundWorkerHandle
+ *handle</parameter>)</function> function and passing the
+ <type>BackgroundWorkerHandle *</type> obtained at registration. This
+ function will block until the background worker exits, or postmaster dies.
+ When the background worker exits, the return value is
+ <literal>BGWH_STOPPED</literal>, if postmaster dies it will return
+ <literal>BGWH_POSTMASTER_DIED</literal>.
+ </para>
+
+ <para>
If a background worker sends asynchronous notifications with the
<command>NOTIFY</command> command via the Server Programming Interface
(<acronym>SPI</acronym>), it should call