directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r462655 - in /directory: branches/mina/1.0/core/src/main/java/org/apache/mina/util/ExpiringMap.java trunks/mina/core/src/main/java/org/apache/mina/util/ExpiringMap.java
Date Wed, 11 Oct 2006 01:25:45 GMT
Author: trustin
Date: Tue Oct 10 18:25:44 2006
New Revision: 462655

URL: http://svn.apache.org/viewvc?view=rev&rev=462655
Log:
Fixed issue: DIRMINA-277 (Various tests block with JDK5 concurrent used in place of backport)
* Fixed my mistake (not releasing a read lock before releasing a write lock) in ExpiringMap


Modified:
    directory/branches/mina/1.0/core/src/main/java/org/apache/mina/util/ExpiringMap.java
    directory/trunks/mina/core/src/main/java/org/apache/mina/util/ExpiringMap.java

Modified: directory/branches/mina/1.0/core/src/main/java/org/apache/mina/util/ExpiringMap.java
URL: http://svn.apache.org/viewvc/directory/branches/mina/1.0/core/src/main/java/org/apache/mina/util/ExpiringMap.java?view=diff&rev=462655&r1=462654&r2=462655
==============================================================================
--- directory/branches/mina/1.0/core/src/main/java/org/apache/mina/util/ExpiringMap.java (original)
+++ directory/branches/mina/1.0/core/src/main/java/org/apache/mina/util/ExpiringMap.java Tue
Oct 10 18:25:44 2006
@@ -361,10 +361,16 @@
         public void startExpiringIfNotStarted()
         {
             stateLock.readLock().lock();
-            if( running )
+            try
+            {
+                if( running )
+                {
+                    return;
+                }
+            }
+            finally
             {
                 stateLock.readLock().unlock();
-                return;
             }
             
             stateLock.writeLock().lock();

Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/util/ExpiringMap.java
URL: http://svn.apache.org/viewvc/directory/trunks/mina/core/src/main/java/org/apache/mina/util/ExpiringMap.java?view=diff&rev=462655&r1=462654&r2=462655
==============================================================================
--- directory/trunks/mina/core/src/main/java/org/apache/mina/util/ExpiringMap.java (original)
+++ directory/trunks/mina/core/src/main/java/org/apache/mina/util/ExpiringMap.java Tue Oct
10 18:25:44 2006
@@ -361,12 +361,18 @@
         public void startExpiringIfNotStarted()
         {
             stateLock.readLock().lock();
-            if( running )
+            try
+            {
+                if( running )
+                {
+                    return;
+                }
+            }
+            finally
             {
                 stateLock.readLock().unlock();
-                return;
             }
-            
+
             stateLock.writeLock().lock();
             try
             {



Mime
View raw message