From 2a67096e1f55b8f5489d6865c7ec3c86771500b4 Mon Sep 17 00:00:00 2001 From: Daniel Gustafsson Date: Fri, 9 Feb 2018 23:22:02 +0100 Subject: [PATCH] doc: Add WaitForBackgroundWorkerShutdown() to bgw docs Commit 924bcf4f16d extended the background worker API with WaitForBackgroundWorkerShutdown, but it was never added to the documentation. Extend the bgworker docs, and also fix two small spelling errors in the WaitForBackgroundWorkerStartup paragraph. --- doc/src/sgml/bgworker.sgml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/doc/src/sgml/bgworker.sgml b/doc/src/sgml/bgworker.sgml index e490bb8750..099639964c 100644 --- a/doc/src/sgml/bgworker.sgml +++ b/doc/src/sgml/bgworker.sgml @@ -259,13 +259,24 @@ typedef struct BackgroundWorker WaitForBackgroundWorkerStartup(BackgroundWorkerHandle *handle, pid_t *) 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 BGWH_STARTED, and + background worker, or until the postmaster dies. If the background worker + is running, the return value will be BGWH_STARTED, and the PID will be written to the provided address. Otherwise, the return value will be BGWH_STOPPED or BGWH_POSTMASTER_DIED. + + A process can also wait for a background worker to shut down, by using the + WaitForBackgroundWorkerShutdown(BackgroundWorkerHandle + *handle) function and pass the + BackgroundWorkerHandle * obtained at registration. This + function will block until the background worker exits, or the postmaster + dies. When the background worker exits, the return value is + BGWH_STOPPED, if the postmaster dies it will return + BGWH_POSTMASTER_DIED. + + If a background worker sends asynchronous notifications with the NOTIFY command via the Server Programming Interface -- 2.14.1.145.gb3622a4ee