Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ekHOK-0000EF-40 for pgsql-docs@arkaria.postgresql.org; Fri, 09 Feb 2018 22:43:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ekHOI-0002KL-OF for pgsql-docs@arkaria.postgresql.org; Fri, 09 Feb 2018 22:43:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ekHOI-0002KB-Ec for pgsql-docs@lists.postgresql.org; Fri, 09 Feb 2018 22:43:34 +0000 Received: from mail-lf0-x22e.google.com ([2a00:1450:4010:c07::22e]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ekHOF-0004dB-Mn for pgsql-docs@postgresql.org; Fri, 09 Feb 2018 22:43:33 +0000 Received: by mail-lf0-x22e.google.com with SMTP id h78so6078774lfg.6 for ; Fri, 09 Feb 2018 14:43:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:subject:message-id:date:to:mime-version; bh=PwdFX25vMUEcsO96sPllgdlph9l/IPIBvz2+YcBQ+Jw=; b=oL+Z+dL+/xI0FWri4IZ0RJg1s6Ym0jN+QHDG95M9zwR3Hq20eBVsa55nO21n0n2EMH tE5R0jRwR+3bT/ssD2zowFZKvq+R0vYPUkfeIdSORrjQ/8n35tzQVFx/6jDt8CP3o2Eo o4HMIFOWN1lDKAcFxB3ZEwf4/e8mUObsL+Jttb1lrFV7Wq8TE6+N9ccs/VpJ29+TlpYa HZYXTCgeq6Oz+g+/Fcxger+amI1gp2uwjPEeeWgR+lfZx0SlWkTijwRMNWvkDqoNWOYV c9dpG/NB30hfbI6s7RV+t/ohixVzVjEOOXl4bztdhn/IRvQUSfZgMig81Bo/dn+mbmwm EmLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:subject:message-id:date:to :mime-version; bh=PwdFX25vMUEcsO96sPllgdlph9l/IPIBvz2+YcBQ+Jw=; b=a1oHIPBsMKCz01s/pT0IPpdx0INcmDUxCa348N4Q4jmnkANBtyYlzgkmlHJ/ITxqbU OkHEBFkp6qo4N4pPJZ1dthy7iKk0vbRvdXc0UYoVlE09GgYSlFArX/hKVQ/MIputxTen 4cIKenwARJD0L5gsfLRo2YR17qalzH+gwxxCZvxtJx1c9ZhSgGkjyuRao1GeZ9b3ar+Q WHin0v/SnxPeE0qbdLW5zEc/RcfYdPimZTm74LnZpLfVHccPC26VcvY1nkaOnjF1qqmL bh9IJFFkyLAqhsCzVmcCbQmuftLOQNTZ50KcIma6nzbfLFkSSUTGTz2KgAN/gxhTqYnz ss4A== X-Gm-Message-State: APf1xPDWui+GnV4pLDP6+3EqWbqRKlq3EfuJK7BLZgP+8o9Ef4YzrlBG T6YQSdPb9rSoJKF6iUGYXP6Li+Ox X-Google-Smtp-Source: AH8x2258w/jboeI7J0KQBEA5KOnMNNepd+KLOpcqhZNH90rLqeAtvEnHEQEIK3zbvs3/QtRl5AA1DA== X-Received: by 10.46.2.1 with SMTP id 1mr3117291ljc.0.1518216208492; Fri, 09 Feb 2018 14:43:28 -0800 (PST) Received: from [192.168.1.69] (c-c67ce055.027-294-73746f71.cust.bredbandsbolaget.se. [85.224.124.198]) by smtp.gmail.com with ESMTPSA id m187sm624117lfe.39.2018.02.09.14.43.27 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Feb 2018 14:43:27 -0800 (PST) Sender: Daniel Gustafson From: Daniel Gustafsson Content-Type: multipart/mixed; boundary="Apple-Mail=_583A1809-E55F-4B6C-B189-9056CEA0B160" Subject: Document WaitForBackgroundWorkerShutdown and fix bgworker typo Message-Id: Date: Fri, 9 Feb 2018 23:43:26 +0100 To: pgsql-docs Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) X-Mailer: Apple Mail (2.3124) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail=_583A1809-E55F-4B6C-B189-9056CEA0B160 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii WaitForBackgroundWorkerShutdown() was added in 924bcf4f16d, but never documented which seems like an oversight for such a useful function. The attached patch adds this to bgworker.sgml, and also fixes what I believe are typos in the WaitForBackgroundWorkerStartup paragraph. cheers ./daniel --Apple-Mail=_583A1809-E55F-4B6C-B189-9056CEA0B160 Content-Disposition: attachment; filename=bgworker.patch Content-Type: application/octet-stream; name="bgworker.patch" Content-Transfer-Encoding: quoted-printable =46rom=202a67096e1f55b8f5489d6865c7ec3c86771500b4=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Daniel=20Gustafsson=20=0A= Date:=20Fri,=209=20Feb=202018=2023:22:02=20+0100=0ASubject:=20[PATCH]=20= doc:=20Add=20WaitForBackgroundWorkerShutdown()=20to=20bgw=20docs=0A=0A= Commit=20924bcf4f16d=20extended=20the=20background=20worker=20API=20with=0A= WaitForBackgroundWorkerShutdown,=20but=20it=20was=20never=20added=20to=20= the=0Adocumentation.=20Extend=20the=20bgworker=20docs,=20and=20also=20= fix=20two=20small=0Aspelling=20errors=20in=20the=20= WaitForBackgroundWorkerStartup=20paragraph.=0A---=0A=20= doc/src/sgml/bgworker.sgml=20|=2015=20+++++++++++++--=0A=201=20file=20= changed,=2013=20insertions(+),=202=20deletions(-)=0A=0Adiff=20--git=20= a/doc/src/sgml/bgworker.sgml=20b/doc/src/sgml/bgworker.sgml=0Aindex=20= e490bb8750..099639964c=20100644=0A---=20a/doc/src/sgml/bgworker.sgml=0A= +++=20b/doc/src/sgml/bgworker.sgml=0A@@=20-259,13=20+259,24=20@@=20= typedef=20struct=20BackgroundWorker=0A=20=20=20=20= WaitForBackgroundWorkerStartup(BackgroundWorkerHandle= =0A=20=20=20=20*handle,=20pid_t=20= *)=20function.=0A=20=20=20=20This=20function=20= will=20block=20until=20the=20postmaster=20has=20attempted=20to=20start=20= the=0A-=20=20=20background=20worker,=20or=20until=20the=20postmaster=20= dies.=20=20If=20the=20background=20runner=0A-=20=20=20is=20running,=20= the=20return=20value=20will=20BGWH_STARTED,=20and=0A+=20= =20=20background=20worker,=20or=20until=20the=20postmaster=20dies.=20=20= If=20the=20background=20worker=0A+=20=20=20is=20running,=20the=20return=20= value=20will=20be=20BGWH_STARTED,=20and=0A=20=20=20=20= the=20PID=20will=20be=20written=20to=20the=20provided=20address.=20=20= Otherwise,=20the=20return=0A=20=20=20=20value=20will=20be=20= BGWH_STOPPED=20or=0A=20=20=20=20= BGWH_POSTMASTER_DIED.=0A=20=20=20=0A=20=0A+=20=20= =0A+=20=20=20A=20process=20can=20also=20wait=20for=20a=20= background=20worker=20to=20shut=20down,=20by=20using=20the=0A+=20=20=20= WaitForBackgroundWorkerShutdown(BackgroundWorkerHandl= e=0A+=20=20=20*handle)=20function=20and=20pass=20= the=0A+=20=20=20BackgroundWorkerHandle=20*=20obtained=20at=20= registration.=20This=0A+=20=20=20function=20will=20block=20until=20the=20= background=20worker=20exits,=20or=20the=20postmaster=0A+=20=20=20dies.=20= =20When=20the=20background=20worker=20exits,=20the=20return=20value=20is=0A= +=20=20=20BGWH_STOPPED,=20if=20the=20postmaster=20= dies=20it=20will=20return=0A+=20=20=20= BGWH_POSTMASTER_DIED.=0A+=20=20=0A+=0A=20=20=20= =0A=20=20=20=20If=20a=20background=20worker=20sends=20asynchronous=20= notifications=20with=20the=0A=20=20=20=20NOTIFY=20= command=20via=20the=20Server=20Programming=20Interface=0A--=20=0A= 2.14.1.145.gb3622a4ee=0A=0A= --Apple-Mail=_583A1809-E55F-4B6C-B189-9056CEA0B160--