Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F18A360A6 for ; Fri, 29 Jul 2011 03:21:44 +0000 (UTC) Received: (qmail 36731 invoked by uid 500); 29 Jul 2011 03:21:43 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 36622 invoked by uid 500); 29 Jul 2011 03:21:39 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 36612 invoked by uid 99); 29 Jul 2011 03:21:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jul 2011 03:21:38 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jul 2011 03:21:35 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 1ECAD23889B2 for ; Fri, 29 Jul 2011 03:21:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110729032114.1ECAD23889B2@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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. *