]> granicus.if.org Git - postgresql/commit
On Windows, syslogger runs in two threads. The main thread processes config
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Fri, 16 Apr 2010 09:52:15 +0000 (09:52 +0000)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Fri, 16 Apr 2010 09:52:15 +0000 (09:52 +0000)
commit345c2c5e7638b22ccab5d5ed8129c21c29ec43be
treec02025151bec5064260e3823096fd5a1f306fea2
parent06464ef972612c96f7e00dbc33325b97f7c39551
On Windows, syslogger runs in two threads. The main thread processes config
reload and rotation signals, and a helper thread reads messages from the
pipe and writes them to the log file. However, server code isn't generally
thread-safe, so if both try to do e.g palloc()/pfree() at the same time,
bad things will happen. To fix that, use a critical section (which is like
a mutex) to enforce that only one the threads are active at a time.
src/backend/postmaster/syslogger.c