On Mon, Jan 8, 2024 at 9:40 PM Andy Fan <zhihuifan1...@163.com> wrote: > The singler handler I was refering to is 'CHECK_FOR_INTERRUPTS', Based > on this, spin_lock and lwlock are acted pretty differently.
CHECK_FOR_INTERRUPTS() is not a signal handler, and it's OK to acquire and release spin locks or lwlocks there. We have had (and I think still do have) cases where signal handlers do non-trivial work, resulting in serious problems in some cases. A bunch of that stuff has been rewritten to just set a flag and then let the calling code sort it out, but not everything has been rewritten that way (I think) and there's always a danger of future hackers introducing new problem cases. -- Robert Haas EDB: http://www.enterprisedb.com