Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 7175 invoked from network); 6 Apr 2006 13:39:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Apr 2006 13:39:10 -0000 Received: (qmail 96466 invoked by uid 500); 6 Apr 2006 13:38:54 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 96361 invoked by uid 500); 6 Apr 2006 13:38:54 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 96296 invoked by uid 500); 6 Apr 2006 13:38:54 -0000 Delivered-To: apmail-jakarta-tomcat-dev@jakarta.apache.org Received: (qmail 96239 invoked by uid 99); 6 Apr 2006 13:38:53 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Apr 2006 06:38:53 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 06 Apr 2006 06:38:53 -0700 Received: (qmail 6804 invoked by uid 65534); 6 Apr 2006 13:38:29 -0000 Message-ID: <20060406133829.6801.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r391984 - /tomcat/connectors/trunk/jni/native/src/poll.c Date: Thu, 06 Apr 2006 13:38:28 -0000 To: tomcat-dev@jakarta.apache.org From: mturk@apache.org X-Mailer: svnmailer-1.0.7 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: mturk Date: Thu Apr 6 06:38:26 2006 New Revision: 391984 URL: http://svn.apache.org/viewcvs?rev=391984&view=rev Log: Check for EINTR inside poll call. This will lower the number of JNI calls in case EINTR is signaled. Modified: tomcat/connectors/trunk/jni/native/src/poll.c Modified: tomcat/connectors/trunk/jni/native/src/poll.c URL: http://svn.apache.org/viewcvs/tomcat/connectors/trunk/jni/native/src/poll.c?rev=391984&r1=391983&r2=391984&view=diff ============================================================================== --- tomcat/connectors/trunk/jni/native/src/poll.c (original) +++ tomcat/connectors/trunk/jni/native/src/poll.c Thu Apr 6 06:38:26 2006 @@ -55,6 +55,7 @@ int sp_poll_timeout; int sp_overflow; int sp_equals; + int sp_eintr; #endif } tcn_pollset_t; @@ -75,6 +76,7 @@ fprintf(stderr, "Maintained : %d\n", p->sp_maintained); fprintf(stderr, "Max. maintained : %d\n", p->sp_max_maintained); fprintf(stderr, "Number of duplicates : %d\n", p->sp_equals); + fprintf(stderr, "Number of interrupts : %d\n", p->sp_eintr); } @@ -249,15 +251,25 @@ #ifdef TCN_DO_STATISTICS p->sp_poll++; #endif - if ((rv = apr_pollset_poll(p->pollset, J2T(timeout), &num, &fd)) != APR_SUCCESS) { - TCN_ERROR_WRAP(rv); + for (;;) { + rv = apr_pollset_poll(p->pollset, J2T(timeout), &num, &fd); + if (rv != APR_SUCCESS) { + if (APR_STATUS_IS_EINTR(rv)) { #ifdef TCN_DO_STATISTICS - if (rv == TCN_TIMEUP) - p->sp_poll_timeout++; - else - p->sp_err_poll++; + p->sp_eintr++; #endif - num = (apr_int32_t)(-rv); + continue; + } + TCN_ERROR_WRAP(rv); +#ifdef TCN_DO_STATISTICS + if (rv == TCN_TIMEUP) + p->sp_poll_timeout++; + else + p->sp_err_poll++; +#endif + num = (apr_int32_t)(-rv); + } + break; } if (num > 0) { #ifdef TCN_DO_STATISTICS --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org