On Windows, syslogger runs in two threads. The main thread processes config
authorHeikki Linnakangas <[email protected]>
Fri, 16 Apr 2010 09:52:01 +0000 (09:52 +0000)
committerHeikki Linnakangas <[email protected]>
Fri, 16 Apr 2010 09:52:01 +0000 (09:52 +0000)
commit144399a331c9ac7059669a16d470239753257ac5
tree10f4a923646fe0a23c57d22d5e8468223fb818f7
parentfc4fac0598d6347ea72701ee0f794c1a9932c6f1
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