Author: ron.sigal(a)jboss.com
Date: 2010-05-28 11:52:52 -0400 (Fri, 28 May 2010)
New Revision: 5868
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java
remoting2/branches/2.x/src/main/org/jboss/remoting/loading/RemotingClassLoader.java
Log:
JBREM-1227: Moved synchronization from RemotingClassLoader to MicroRemoteClientInvoker.
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java
===================================================================
---
remoting2/branches/2.x/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java 2010-05-12
03:07:58 UTC (rev 5867)
+++
remoting2/branches/2.x/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java 2010-05-28
15:52:52 UTC (rev 5868)
@@ -169,7 +169,10 @@
finally
{
// Delete reference to current thread's context classloader.
- rcl.unsetUserClassLoader();
+ synchronized (MicroRemoteClientInvoker.class)
+ {
+ rcl.unsetUserClassLoader();
+ }
}
// Now check if is remoting response and process
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/loading/RemotingClassLoader.java
===================================================================
---
remoting2/branches/2.x/src/main/org/jboss/remoting/loading/RemotingClassLoader.java 2010-05-12
03:07:58 UTC (rev 5867)
+++
remoting2/branches/2.x/src/main/org/jboss/remoting/loading/RemotingClassLoader.java 2010-05-28
15:52:52 UTC (rev 5868)
@@ -51,7 +51,11 @@
referenceCounter = 1;
}
- public synchronized void setUserClassLoader(ClassLoader userClassLoader)
+ /*
+ * Note: This method is called only from MicroRemoteClientInvoker.invoke() while a
lock
+ * on MicroRemoteClientInvoker.class is held.
+ */
+ public void setUserClassLoader(ClassLoader userClassLoader)
throws Exception
{
if (this.userClassLoader == null)
@@ -65,7 +69,11 @@
referenceCounter++;
}
- public synchronized void unsetUserClassLoader()
+ /*
+ * Note: This method is called only from MicroRemoteClientInvoker.invoke() while a
lock
+ * on MicroRemoteClientInvoker.class is held.
+ */
+ public void unsetUserClassLoader()
{
if (--referenceCounter == 0)
userClassLoader = null;
Show replies by date