Re: Dangerous code in syslogger?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Dangerous code in syslogger?
Дата
Msg-id 12916.1099689317@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Dangerous code in syslogger?  ("Magnus Hagander" <mha@sollentuna.net>)
Список pgsql-hackers-win32
"Magnus Hagander" <mha@sollentuna.net> writes:
> I'm trying to track down a problem with socket inheritance and the
> syslogger, and I noticed something that I think is very dangerous code:
> The function pipeThread() is called on a non-default thread, and yet
> uses ereport(). ereport() is, AFAIK, not thread-safe. Am I mistaken
> here, or is this a crash waiting to happen?

I think you're right.  Might be best to restructure the locking so that
rather than protecting only access to syslogFile, the data transfer
thread holds the lock whenever it's not doing ReadFile() from the pipe,
and the main thread likewise holds the lock except when sleeping.

            regards, tom lane

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

Предыдущее
От: "Magnus Hagander"
Дата:
Сообщение: Dangerous code in syslogger?
Следующее
От: Tom Lane
Дата:
Сообщение: Isn't win32_make_absolute() a waste of time?