apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r750708 - /apr/apr/trunk/poll/unix/port.c
Date Fri, 06 Mar 2009 00:35:29 GMT
Author: trawick
Date: Fri Mar  6 00:35:29 2009
New Revision: 750708

URL: http://svn.apache.org/viewvc?rev=750708&view=rev
Log:
elements on the add ring are not currently associated, so only call 
port_dissociate (sic) if it isn't on the add ring

when we remove an element from the add ring, we can release it 
immediately to the free ring

(elements removed from the query ring are the ones that have to be
placed on the dead ring temporarily)

Modified:
    apr/apr/trunk/poll/unix/port.c

Modified: apr/apr/trunk/poll/unix/port.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/poll/unix/port.c?rev=750708&r1=750707&r2=750708&view=diff
==============================================================================
--- apr/apr/trunk/poll/unix/port.c (original)
+++ apr/apr/trunk/poll/unix/port.c Fri Mar  6 00:35:29 2009
@@ -217,19 +217,15 @@
         fd = descriptor->desc.f->filedes;
     }
 
-    res = port_dissociate(pollset->p->port_fd, PORT_SOURCE_FD, fd);
-
-    if (res < 0) {
-        err = errno;
-        rv = APR_NOTFOUND;
-    }
-
     /* Search the add ring first.  This ring is often shorter,
      * and it often contains the descriptor being removed.  
      * (For the common scenario where apr_pollset_poll() 
      * returns activity for the descriptor and the descriptor
      * is then removed from the pollset, it will have just 
      * been moved to the add ring by apr_pollset_poll().)
+     *
+     * If it is on the add ring, it isn't associated with the
+     * event port yet/anymore.
      */
     found = 0;
     for (ep = APR_RING_FIRST(&(pollset->p->add_ring));
@@ -240,16 +236,20 @@
         if (descriptor->desc.s == ep->pfd.desc.s) {
             found = 1;
             APR_RING_REMOVE(ep, link);
-            APR_RING_INSERT_TAIL(&(pollset->p->dead_ring),
+            APR_RING_INSERT_TAIL(&(pollset->p->free_ring),
                                  ep, pfd_elem_t, link);
-            if (ENOENT == err) {
-                rv = APR_SUCCESS;
-            }
             break;
         }
     }
 
     if (!found) {
+        res = port_dissociate(pollset->p->port_fd, PORT_SOURCE_FD, fd);
+
+        if (res < 0) {
+            err = errno;
+            rv = APR_NOTFOUND;
+        }
+
         for (ep = APR_RING_FIRST(&(pollset->p->query_ring));
              ep != APR_RING_SENTINEL(&(pollset->p->query_ring),
                                      pfd_elem_t, link);



Mime
View raw message