Re: [HACKERS] Should we standardize on a type for signal handler flags?
В списке pgsql-hackers по дате отправления:
| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера