commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r1139279 - /commons/sandbox/runtime/trunk/src/main/native/os/linux/epoll.c
Date Fri, 24 Jun 2011 12:45:17 GMT
Author: mturk
Date: Fri Jun 24 12:45:17 2011
New Revision: 1139279

URL: http://svn.apache.org/viewvc?rev=1139279&view=rev
Log:
Optimize TTL check. No need to ckeck if signaled

Modified:
    commons/sandbox/runtime/trunk/src/main/native/os/linux/epoll.c

Modified: commons/sandbox/runtime/trunk/src/main/native/os/linux/epoll.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/linux/epoll.c?rev=1139279&r1=1139278&r2=1139279&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/linux/epoll.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/linux/epoll.c Fri Jun 24 12:45:17 2011
@@ -520,7 +520,8 @@ ACR_NET_EXPORT(jint, UnixSelector, wait0
                 continue;
             }
             else {
-                pevents[rv] = reventt(ps->epset[i].events);
+                pe->revents = reventt(ps->epset[i].events);
+                pevents[rv] = pe->revents;
                 (*env)->SetObjectArrayElement(env, rs, rv++, pe->obj);
                 if (autocancel == JNI_TRUE) {
                     epoll_ctl(ps->epfd, EPOLL_CTL_DEL, pe->fd, &ev);
@@ -543,7 +544,7 @@ ACR_NET_EXPORT(jint, UnixSelector, wait0
 cleanup:
     /* Remove expired descriptors */
     ACR_RING_FOREACH_SAFE(pe, np, &ps->eset_ring, pfd_elem_t, link) {
-        if (pe->ttl > 0) {
+        if (pe->ttl > 0 && pe->revents == 0) {
             if (now == 0)
                 now = AcrTimeNow();
             if (now > pe->exp) {



Mime
View raw message