apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r124350 - /apr/apr/trunk/poll/unix/port.c
Date Thu, 06 Jan 2005 07:04:25 GMT
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;

Mime
View raw message