Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 69873 invoked from network); 7 Jul 2005 07:09:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 7 Jul 2005 07:09:30 -0000 Received: (qmail 71231 invoked by uid 500); 7 Jul 2005 07:09:29 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 71184 invoked by uid 500); 7 Jul 2005 07:09:28 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 71162 invoked by uid 99); 7 Jul 2005 07:09:28 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jul 2005 00:09:28 -0700 X-ASF-Spam-Status: No, hits=-9.8 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, 07 Jul 2005 00:09:14 -0700 Received: (qmail 69783 invoked by uid 65534); 7 Jul 2005 07:09:10 -0000 Message-ID: <20050707070910.69782.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r209570 - /directory/network/trunk/src/java/org/apache/mina/filter/ThreadPoolFilter.java Date: Thu, 07 Jul 2005 07:09:10 -0000 To: commits@directory.apache.org From: trustin@apache.org X-Mailer: svnmailer-1.0.2 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: trustin Date: Thu Jul 7 00:09:09 2005 New Revision: 209570 URL: http://svn.apache.org/viewcvs?rev=209570&view=rev Log: Fix for DIRMINA-72 * busySessionBuffers has not been maintained correctly. Modified: directory/network/trunk/src/java/org/apache/mina/filter/ThreadPoolFilter.java Modified: directory/network/trunk/src/java/org/apache/mina/filter/ThreadPoolFilter.java URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/filter/ThreadPoolFilter.java?rev=209570&r1=209569&r2=209570&view=diff ============================================================================== --- directory/network/trunk/src/java/org/apache/mina/filter/ThreadPoolFilter.java (original) +++ directory/network/trunk/src/java/org/apache/mina/filter/ThreadPoolFilter.java Thu Jul 7 00:09:09 2005 @@ -165,7 +165,8 @@ if( buf == null ) { buf = new SessionBuffer( session ); - buffers.put( session, buf ); + Object old = buffers.put( session, buf ); + //System.out.println( "new " + System.identityHashCode( session ) + " (" + ( old == null ) + ')' ); } } } @@ -178,7 +179,8 @@ final IoSession session = buf.session; synchronized( buffers ) { - buffers.remove( session ); + Object old = buffers.remove( session ); + //System.out.println( Thread.currentThread().getName() + " del " + System.identityHashCode( session ) + " (" + ( old != null ) + ')' ); } } @@ -216,12 +218,15 @@ public void run() { + String name = Thread.currentThread().getName(); for( ;; ) { if( !waitForPromotion() ) break; - + + //System.out.println( name + " promoted" ); SessionBuffer buf = fetchBuffer(); + //System.out.println( name + " fetched: " + (buf != null? System.identityHashCode(buf) : 0 ) ); giveUpLead(); if( buf == null ) @@ -319,9 +324,10 @@ synchronized( readySessionBuffers ) { - busySessionBuffers.remove( buf ); if( eventQueue.isEmpty() ) { + boolean removed = busySessionBuffers.remove( buf ); + //System.out.println( Thread.currentThread().getName() + " busyDel: " + System.identityHashCode( buf.session ) + " (" + removed + ')' ); removeSessionBuffer( buf ); } else @@ -405,24 +411,32 @@ private static class EventType { - public static final EventType OPENED = new EventType(); + public static final EventType OPENED = new EventType( "OPENED" ); - public static final EventType CLOSED = new EventType(); + public static final EventType CLOSED = new EventType( "CLOSED" ); - public static final EventType READ = new EventType(); + public static final EventType READ = new EventType( "READ" ); - public static final EventType WRITTEN = new EventType(); + public static final EventType WRITTEN = new EventType( "WRITTEN" ); - public static final EventType RECEIVED = new EventType(); + public static final EventType RECEIVED = new EventType( "RECEIVED" ); - public static final EventType SENT = new EventType(); + public static final EventType SENT = new EventType( "SENT" ); - public static final EventType IDLE = new EventType(); + public static final EventType IDLE = new EventType( "IDLE" ); - public static final EventType EXCEPTION = new EventType(); + public static final EventType EXCEPTION = new EventType( "EXCEPTION" ); - private EventType() + private final String value; + + private EventType( String value ) + { + this.value = value; + } + + public String toString() { + return value; } }