You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by pq...@apache.org on 2005/01/06 08:04:25 UTC

svn commit: r124350 - /apr/apr/trunk/poll/unix/port.c

Author: pquerna
Date: Wed Jan  5 23:04:24 2005
New Revision: 124350

URL: http://svn.apache.org/viewcvs?view=rev&rev=124350
Log:
* Fix compiler warning for type mismatch on nget.
* Add locking to prevent a race condition that the Event MPM hit.

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

Modified: apr/apr/trunk/poll/unix/port.c
Url: http://svn.apache.org/viewcvs/apr/apr/trunk/poll/unix/port.c?view=diff&rev=124350&p1=apr/apr/trunk/poll/unix/port.c&r1=124349&p2=apr/apr/trunk/poll/unix/port.c&r2=124350
==============================================================================
--- apr/apr/trunk/poll/unix/port.c	(original)
+++ apr/apr/trunk/poll/unix/port.c	Wed Jan  5 23:04:24 2005
@@ -248,7 +248,8 @@
                                            const apr_pollfd_t **descriptors)
 {
     apr_os_sock_t fd;
-    int ret, i, nget;
+    int ret, i;
+    unsigned int nget;
     pfd_elem_t *ep;
     struct timespec tv, *tvptr;
     apr_status_t rv = APR_SUCCESS;
@@ -303,6 +304,8 @@
     }
     else {
 
+        pollset_lock_rings();
+
         for (i = 0; i < nget; i++) {
             pollset->result_set[i] =
                 (((pfd_elem_t*)(pollset->port_set[i].portev_user))->pfd);
@@ -313,6 +316,8 @@
                                  (pfd_elem_t*)pollset->port_set[i].portev_user,
                                  pfd_elem_t, link);
         }
+
+        pollset_unlock_rings();
 
         if (descriptors) {
             *descriptors = pollset->result_set;