• Tom Lane's avatar
    Change the autovacuum launcher to use WaitLatch instead of a poll loop. · 4dab3d5a
    Tom Lane authored
    In pursuit of this (and with the expectation that WaitLatch will be needed
    in more places), convert the latch field that was already added to PGPROC
    for sync rep into a generic latch that is activated for all PGPROC-owning
    processes, and change many of the standard backend signal handlers to set
    that latch when a signal happens.  This will allow WaitLatch callers to be
    wakened properly by these signals.
    
    In passing, fix a whole bunch of signal handlers that had been hacked to do
    things that might change errno, without adding the necessary save/restore
    logic for errno.  Also make some minor fixes in unix_latch.c, and clean
    up bizarre and unsafe scheme for disowning the process's latch.  Much of
    this has to be back-patched into 9.1.
    
    Peter Geoghegan, with additional work by Tom
    4dab3d5a
unix_latch.c 14.8 KB