Peter Geoghegan wrote:
--- 247,277 ----
                 * do that), and the select() will return immediately.
                 */
                drainSelfPipe();
!               if (latch->is_set && (wakeEvents & WL_LATCH_SET))
!               {
!                       result |= WL_LATCH_SET;
!                       found = true;
!                       /*
!                        * Leave loop immediately, avoid blocking again.
!                        * Since latch is set, no other factor could have
!                        * coincided that could make us wake up
!                        * independently of the latch being set, so no
!                        * need to worry about having missed something.
!                        */
                        break;
                }

I don't understand that comment. Why can't e.g postmaster death happen at the same time as a latch is set? I think the code is fine as it is, we just need to document that if there are several events that would wake up WaitLatch(), we make no promise that we return all of them in the return value. I believe all the callers would be fine with that.

--
  Heikki Linnakangas
  EnterpriseDB   http://www.enterprisedb.com

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to