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

From Tom Lane
Subject Re: Proposal for Signal Detection Refactoring
Date
Msg-id 6982.1537839491@sss.pgh.pa.us
Whole thread Raw
In response to Re: Proposal for Signal Detection Refactoring  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Proposal for Signal Detection Refactoring  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
Michael Paquier <michael@paquier.xyz> writes:
> At the same time, all the pending flags in miscadmin.h could be switched
> to sig_atomic_t if we were to be correct, no?  The counters could be
> higher than 256 so that's not really possible. 

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.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Proposal for Signal Detection Refactoring
Next
From: "Tsunakawa, Takayuki"
Date:
Subject: RE: Changing the setting of wal_sender_timeout per standby