Re: [HACKERS] Should we standardize on a type for signal handler flags?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] Should we standardize on a type for signal handler flags?
Дата
Msg-id 4688.1496618801@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] Should we standardize on a type for signal handlerflags?  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On 2017-06-04 19:14:06 -0400, Tom Lane wrote:
>> sig_atomic_t is more standards-conforming, I should think.  I'm not sure
>> if there are any current platforms where a store to a char variable
>> wouldn't be atomic, but why live dangerously?

> Well, we already have some variables that aren't actually booleans,
> although I think all of them are only read not manipulated in signal
> handlers (InterruptHoldoffCount etc).

Hm.  Well, according to POSIX one may rely on sig_atomic_t being able
to hold the values 0..127 on all platforms.  So we might be able to
get away with converting InterruptHoldoffCount to sig_atomic_t if we
needed to.  In the absence of evidence that we need to, I wouldn't.
But I have no problem with standardizing on using sig_atomic_t for
variables that are assigned to by signal handlers.
        regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: [HACKERS] Should we standardize on a type for signal handlerflags?
Следующее
От: Mark Kirkwood
Дата:
Сообщение: Re: [HACKERS] logical replication - still unstable after all thesemonths