qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grk...@apache.org
Subject svn commit: r979208 - /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/transport/ThreadPoolFilter.java
Date Mon, 26 Jul 2010 09:12:27 GMT
Author: grkvlt
Date: Mon Jul 26 09:12:26 2010
New Revision: 979208

URL: http://svn.apache.org/viewvc?rev=979208&view=rev
Log:
QPID-2757: Remove double checked locking

Modified:
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/transport/ThreadPoolFilter.java

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/transport/ThreadPoolFilter.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/transport/ThreadPoolFilter.java?rev=979208&r1=979207&r2=979208&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/transport/ThreadPoolFilter.java
(original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/transport/ThreadPoolFilter.java
Mon Jul 26 09:12:26 2010
@@ -280,30 +280,23 @@ public class ThreadPoolFilter extends Io
 
     private SessionBuffer getSessionBuffer(IoSession session)
     {
-        final Map buffers = this.buffers;
-        SessionBuffer buf = (SessionBuffer) buffers.get(session);
-        if (buf == null)
+        synchronized (buffers)
         {
-            synchronized (buffers)
+            SessionBuffer buf = (SessionBuffer) buffers.get(session);
+            if (buf == null)
             {
-                buf = (SessionBuffer) buffers.get(session);
-                if (buf == null)
-                {
-                    buf = new SessionBuffer(session);
-                    buffers.put(session, buf);
-                }
+                buf = new SessionBuffer(session);
+                buffers.put(session, buf);
             }
+            return buf;
         }
-        return buf;
     }
 
     private void removeSessionBuffer(SessionBuffer buf)
     {
-        final Map buffers = this.buffers;
-        final IoSession session = buf.session;
         synchronized (buffers)
         {
-            buffers.remove(session);
+            buffers.remove(buf.session);
         }
     }
 



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message