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 | 4257.1496618046@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | [HACKERS] Should we standardize on a type for signal handler flags? (Andres Freund <andres@anarazel.de>) |
| Ответы |
Re: [HACKERS] Should we standardize on a type for signal handlerflags?
|
| Список | pgsql-hackers |
Andres Freund <andres@anarazel.de> writes:
> At the moment a number of flag variables set in signal handlers have
> 'volatile bool' as type, others have 'volatile sig_atomic_t'. That's
> kinda confusing. I think either is safe, but I think we should
> standardize one of them.
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?
I'd be inclined to let the code continue to treat the variables as
if they were bool, ie store "true" and "false" not "1" and "0"
into them. That should be perfectly safe.
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера