From b58f19075745b483206de3c23e7939c2df5abf16 Mon Sep 17 00:00:00 2001 From: pquerna Date: Sat, 12 Mar 2005 00:26:39 +0000 Subject: backport from trunk: Use APR_RING_CONCAT instead of looping. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.1.x@157187 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ poll/unix/epoll.c | 6 +----- poll/unix/kqueue.c | 6 +----- poll/unix/port.c | 6 +----- 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/CHANGES b/CHANGES index cc1cf50f1..948f564d7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.1.1 + *) Use APR_RING_CONCAT for moving dead list in KQueue, sys_epoll, and + Event Ports. [Paul Querna] + *) find_apr.m4: Try installed APR before bundled copy if --with-apr not passed to configure. [Justin Erenkrantz] diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index 9bc4a7d9c..24ac86090 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -256,11 +256,7 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, pollset_lock_rings(); /* Shift all PFDs in the Dead Ring to be Free Ring */ - while (!APR_RING_EMPTY(&(pollset->dead_ring), pfd_elem_t, link)) { - ep = APR_RING_FIRST(&(pollset->dead_ring)); - APR_RING_REMOVE(ep, link); - APR_RING_INSERT_TAIL(&(pollset->free_ring), ep, pfd_elem_t, link); - } + APR_RING_CONCAT(&(pollset->free_ring), &(pollset->dead_ring), pfd_elem_t, link); pollset_unlock_rings(); diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c index daf46369d..e04c132d9 100644 --- a/poll/unix/kqueue.c +++ b/poll/unix/kqueue.c @@ -274,11 +274,7 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, pollset_lock_rings(); /* Shift all PFDs in the Dead Ring to be Free Ring */ - while (!APR_RING_EMPTY(&(pollset->dead_ring), pfd_elem_t, link)) { - ep = APR_RING_FIRST(&(pollset->dead_ring)); - APR_RING_REMOVE(ep, link); - APR_RING_INSERT_TAIL(&(pollset->free_ring), ep, pfd_elem_t, link); - } + APR_RING_CONCAT(&(pollset->free_ring), &(pollset->dead_ring), pfd_elem_t, link); pollset_unlock_rings(); diff --git a/poll/unix/port.c b/poll/unix/port.c index 4ecb56bf3..72f32884f 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -328,11 +328,7 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, pollset_lock_rings(); /* Shift all PFDs in the Dead Ring to be Free Ring */ - while (!APR_RING_EMPTY(&(pollset->dead_ring), pfd_elem_t, link)) { - ep = APR_RING_FIRST(&(pollset->dead_ring)); - APR_RING_REMOVE(ep, link); - APR_RING_INSERT_TAIL(&(pollset->free_ring), ep, pfd_elem_t, link); - } + APR_RING_CONCAT(&(pollset->free_ring), &(pollset->dead_ring), pfd_elem_t, link); pollset_unlock_rings(); -- cgit v1.2.1