tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r620821 - /tomcat/trunk/java/org/apache/catalina/tribes/io/XByteBuffer.java
Date Tue, 12 Feb 2008 15:03:33 GMT
Author: fhanik
Date: Tue Feb 12 07:03:29 2008
New Revision: 620821

URL: http://svn.apache.org/viewvc?rev=620821&view=rev
Log:
remove not needed synchronization

Modified:
    tomcat/trunk/java/org/apache/catalina/tribes/io/XByteBuffer.java

Modified: tomcat/trunk/java/org/apache/catalina/tribes/io/XByteBuffer.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/io/XByteBuffer.java?rev=620821&r1=620820&r2=620821&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/tribes/io/XByteBuffer.java (original)
+++ tomcat/trunk/java/org/apache/catalina/tribes/io/XByteBuffer.java Tue Feb 12 07:03:29 2008
@@ -25,6 +25,7 @@
 import java.io.ObjectOutputStream;
 import java.io.Serializable;
 import java.nio.ByteBuffer;
+import java.util.concurrent.atomic.AtomicInteger;
 
 /**
  * The XByteBuffer provides a dual functionality.
@@ -562,10 +563,10 @@
         throws IOException, ClassNotFoundException, ClassCastException {
         return deserialize(data,offset,length,null);     
     }
-    public static int invokecount = 0;
+    public static AtomicInteger invokecount = new AtomicInteger(0);
     public static Serializable deserialize(byte[] data, int offset, int length, ClassLoader[]
cls) 
         throws IOException, ClassNotFoundException, ClassCastException {
-        synchronized (XByteBuffer.class) { invokecount++;}
+        invokecount.addAndGet(1);
         Object message = null;
         if ( cls == null ) cls = new ClassLoader[0];
         if (data != null) {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message