Re: Proposal for Signal Detection Refactoring - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Proposal for Signal Detection Refactoring
Date
Msg-id 20180925022612.GF1354@paquier.xyz
Whole thread Raw
In response to Re: Proposal for Signal Detection Refactoring  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Proposal for Signal Detection Refactoring  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, Sep 24, 2018 at 09:38:11PM -0400, Tom Lane wrote:
> Yeah, in principle any global variable touched by a signal handler should
> be sig_atomic_t.  I don't know of any modern platform where using "bool"
> is unsafe, but per the C standard it could be.  The case that would be
> worrisome is if setting the variable requires a load/modify/store, which
> does apply to char-sized variables on some ancient platforms.  I think
> there's no need to worry for int-sized variables.

Let's change it then.  ClientConnectionLost needs also to be changed as
miscadmin.h tells that it could be used in a signal handler. What do you
think about the attached?
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: DNS SRV support for LDAP authentication
Next
From: Tom Lane
Date:
Subject: Re: Proposal for Signal Detection Refactoring