Re: Latch implementation that wakes on postmaster death on both win32 and Unix
От | Heikki Linnakangas |
---|---|
Тема | Re: Latch implementation that wakes on postmaster death on both win32 and Unix |
Дата | |
Msg-id | 4DFA12CE.60305@enterprisedb.com обсуждение исходный текст |
Ответ на | Re: Latch implementation that wakes on postmaster death on both win32 and Unix (Peter Geoghegan <peter@2ndquadrant.com>) |
Ответы |
Re: Latch implementation that wakes on postmaster death on
both win32 and Unix
|
Список | pgsql-hackers |
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
В списке pgsql-hackers по дате отправления: