This is an automated email from the ASF dual-hosted git repository.

cliffjansen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git


The following commit(s) were added to refs/heads/main by this push:
     new 4650f3e  PROTON-2472: epoll proactor - fix ready list tracking when 
EINTR in epoll_wait
4650f3e is described below

commit 4650f3e0e549b1d964d40484ae0c5d7bfea3faf5
Author: Cliff Jansen <cliffjan...@apache.org>
AuthorDate: Wed Feb 2 11:20:13 2022 -0800

    PROTON-2472: epoll proactor - fix ready list tracking when EINTR in 
epoll_wait
---
 c/src/proactor/epoll.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/c/src/proactor/epoll.c b/c/src/proactor/epoll.c
index 19867af..6a243be 100644
--- a/c/src/proactor/epoll.c
+++ b/c/src/proactor/epoll.c
@@ -2265,7 +2265,8 @@ static pn_event_batch_t *process(task_t *tsk) {
 
 // Call with both sched_mutex and eventfd_mutex held
 static void schedule_ready_list(pn_proactor_t *p) {
-  // append ready_list_first..ready_list_last to end of sched_ready_last
+  // Append ready_list_first..ready_list_last to end of sched_ready_last
+  // May see several in single do_epoll() if EINTR.
   if (p->ready_list_first) {
     if (p->sched_ready_last)
       p->sched_ready_last->ready_next = p->ready_list_first;  // join them
@@ -2275,11 +2276,11 @@ static void schedule_ready_list(pn_proactor_t *p) {
     if (!p->sched_ready_current)
       p->sched_ready_current = p->sched_ready_first;
     p->ready_list_first = p->ready_list_last = NULL;
-  }
 
-  // Track sched_ready_count to know how many threads may be needed.
-  p->sched_ready_count = p->ready_list_count;
-  p->ready_list_count = 0;
+    // Track sched_ready_count to know how many threads may be needed.
+    p->sched_ready_count += p->ready_list_count;
+    p->ready_list_count = 0;
+  }
 }
 
 // Call with schedule lock and eventfd lock held.  Called only by poller 
thread.

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org

Reply via email to