From b24dc3e68e872568408661a345ea05ff6fa40177 Mon Sep 17 00:00:00 2001 From: fhanik Date: Tue, 12 Feb 2008 15:03:29 +0000 Subject: [PATCH] remove not needed synchronization 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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/java/org/apache/catalina/tribes/io/XByteBuffer.java b/java/org/apache/catalina/tribes/io/XByteBuffer.java index 021cb0e42..4c103f4be 100644 --- a/java/org/apache/catalina/tribes/io/XByteBuffer.java +++ b/java/org/apache/catalina/tribes/io/XByteBuffer.java @@ -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) { -- 2.11.0