On Fri, Feb 10, 2023 at 3:30 AM Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
> Maybe for these cases where a WaitLatch is not desired, it'd be simpler
> to do pg_usleep (5L * 1000 * 1000);
I somehow feel that we should be trying to get rid of cases where
WaitLatch is not desired.
That's probably overly simplistic - there might be cases where the
caller isn't just polling and has a really legitimate need to wait for
5 seconds of wall clock time. But even in that case, it seems like we
want to respond to barriers and interrupts during that time, in almost
all cases.
I wonder if we should have a wrapper around WaitLatch() that documents
that if the latch is set before the time expires, it will reset the
latch and try again to wait for the remaining time, after checking for
interrupts etc.
--
Robert Haas
EDB: http://www.enterprisedb.com