Re: Proposal for Signal Detection Refactoring
| От | Tom Lane |
|---|---|
| Тема | Re: Proposal for Signal Detection Refactoring |
| Дата | |
| Msg-id | 6982.1537839491@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: Proposal for Signal Detection Refactoring (Michael Paquier <michael@paquier.xyz>) |
| Ответы |
Re: Proposal for Signal Detection Refactoring
|
| Список | 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 по дате отправления: