cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1152086 - in /cxf/branches/2.4.x-fixes: ./ api/src/main/java/org/apache/cxf/BusFactory.java
Date Fri, 29 Jul 2011 03:21:13 GMT
Author: dkulp
Date: Fri Jul 29 03:21:13 2011
New Revision: 1152086

URL: http://svn.apache.org/viewvc?rev=1152086&view=rev
Log:
Merged revisions 1152084 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1152084 | dkulp | 2011-07-28 23:18:03 -0400 (Thu, 28 Jul 2011) | 1 line
  
  [CXF-3696] FIx potential lockup in BusFactory
........

Modified:
    cxf/branches/2.4.x-fixes/   (props changed)
    cxf/branches/2.4.x-fixes/api/src/main/java/org/apache/cxf/BusFactory.java

Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jul 29 03:21:13 2011
@@ -1 +1 @@
-/cxf/trunk:1152010,1152083
+/cxf/trunk:1152010,1152083-1152084

Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.4.x-fixes/api/src/main/java/org/apache/cxf/BusFactory.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/api/src/main/java/org/apache/cxf/BusFactory.java?rev=1152086&r1=1152085&r2=1152086&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/api/src/main/java/org/apache/cxf/BusFactory.java (original)
+++ cxf/branches/2.4.x-fixes/api/src/main/java/org/apache/cxf/BusFactory.java Fri Jul 29 03:21:13
2011
@@ -148,19 +148,24 @@ public abstract class BusFactory {
     public static Bus getThreadDefaultBus(boolean createIfNeeded) {
         Bus threadBus;
         synchronized (threadBusses) {
-            if (createIfNeeded) {
-                threadBus = threadBusses.get(Thread.currentThread());
-                if (createIfNeeded && threadBus == null) {
-                    threadBus = getDefaultBus(true);
-                    threadBusses.put(Thread.currentThread(), threadBus);
-                }
-            } else {
-                threadBus = threadBusses.get(Thread.currentThread());
-            }
+            threadBus = threadBusses.get(Thread.currentThread());
+        }
+        if (createIfNeeded && threadBus == null) {
+            threadBus = createThreadBus();
+        }
+        return threadBus;
+    }
+    private static synchronized Bus createThreadBus() {
+        Bus threadBus;
+        synchronized (threadBusses) {
+            threadBus = threadBusses.get(Thread.currentThread());
+        }
+        if (threadBus == null) {
+            threadBus = getDefaultBus(true);
+            threadBusses.put(Thread.currentThread(), threadBus);
         }
         return threadBus;
     }
-
     /**
      * Removes a bus from being a thread default bus for any thread.
      * <p>



Mime
View raw message