Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 9b8aa09

Browse files
committed
Don't use EV_CLEAR for kqueue events.
For the semantics to match the epoll implementation, we need a socket to continue to appear readable/writable if you wait multiple times without doing I/O in between (in Linux terminology: level-triggered rather than edge-triggered). This distinction will be important for later commits. Similar to commit 3b790d2 for Windows. Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com> Discussion: https://postgr.es/m/CA%2BhUKGJAC4Oqao%3DqforhNey20J8CiG2R%3DoBPqvfR0vOJrFysGw%40mail.gmail.com
1 parent 7bc84a1 commit 9b8aa09

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/storage/ipc/latch.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,7 @@ WaitEventAdjustKqueueAdd(struct kevent *k_ev, int filter, int action,
991991
{
992992
k_ev->ident = event->fd;
993993
k_ev->filter = filter;
994-
k_ev->flags = action | EV_CLEAR;
994+
k_ev->flags = action;
995995
k_ev->fflags = 0;
996996
k_ev->data = 0;
997997
AccessWaitEvent(k_ev) = event;
@@ -1003,7 +1003,7 @@ WaitEventAdjustKqueueAddPostmaster(struct kevent *k_ev, WaitEvent *event)
10031003
/* For now postmaster death can only be added, not removed. */
10041004
k_ev->ident = PostmasterPid;
10051005
k_ev->filter = EVFILT_PROC;
1006-
k_ev->flags = EV_ADD | EV_CLEAR;
1006+
k_ev->flags = EV_ADD;
10071007
k_ev->fflags = NOTE_EXIT;
10081008
k_ev->data = 0;
10091009
AccessWaitEvent(k_ev) = event;

0 commit comments

Comments
 (0)