Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > Alvaro Herrera wrote:
> >> I wonder if it's OK to grab an LWLock in a signal handler.
>
> > I am not in a signal handler there --- pg_terminate_backend() happens
> > for the person requesting the termination, not the terminated backend
> > that gets the signal.
>
> A more interesting question is what makes you think that taking
> ProcArrayLock here has any value whatsoever.
I took the lock so I would be sure the PGPROC array was the matching pid
and not some other pid that was created between my check and the setting
of the variable.
-- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB
http://enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +