remove not needed synchronization
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 12 Feb 2008 15:03:29 +0000 (15:03 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 12 Feb 2008 15:03:29 +0000 (15:03 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@620821 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/tribes/io/XByteBuffer.java

index 021cb0e..4c103f4 100644 (file)
@@ -25,6 +25,7 @@ import java.io.ObjectInputStream;
 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 @@ public class XByteBuffer
         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) {