camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmuel...@apache.org
Subject svn commit: r1151054 - /camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultUnitOfWork.java
Date Tue, 26 Jul 2011 10:21:11 GMT
Author: cmueller
Date: Tue Jul 26 10:21:11 2011
New Revision: 1151054

URL: http://svn.apache.org/viewvc?rev=1151054&view=rev
Log:
CAMEL-4264: The routeContext stack of DefaultUnitOfWork should be thread safe - Thanks Matthias
for pointing this out

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultUnitOfWork.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultUnitOfWork.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultUnitOfWork.java?rev=1151054&r1=1151053&r2=1151054&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultUnitOfWork.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultUnitOfWork.java Tue
Jul 26 10:21:11 2011
@@ -141,8 +141,10 @@ public class DefaultUnitOfWork implement
         if (transactedBy != null) {
             transactedBy.clear();
         }
-        if (!routeContextStack.isEmpty()) {
-            routeContextStack.clear();
+        synchronized (routeContextStack) {
+            if (!routeContextStack.isEmpty()) {
+                routeContextStack.clear();
+            }
         }
         if (subUnitOfWorks != null) {
             subUnitOfWorks.clear();
@@ -270,7 +272,7 @@ public class DefaultUnitOfWork implement
     }
 
     public void pushRouteContext(RouteContext routeContext) {
-        synchronized (routeContext) {
+        synchronized (routeContextStack) {
             routeContextStack.add(routeContext);
         }
     }



Mime
View raw message