]> git.ipfire.org Git - thirdparty/postgresql.git/commit
On Windows, syslogger runs in two threads. The main thread processes config
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Fri, 16 Apr 2010 09:51:54 +0000 (09:51 +0000)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Fri, 16 Apr 2010 09:51:54 +0000 (09:51 +0000)
commitb2bc12af46353bdc4863721f5314cf774b60cd3d
tree66654c6171000efde588ce7910575e8b2e297587
parent9df6127bcfac4dce26124d24a98710bef9752fb5
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