You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2010/01/07 21:18:12 UTC

svn commit: r896998 - in /cxf/branches/2.1.x-fixes: ./ rt/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java

Author: dkulp
Date: Thu Jan  7 20:18:11 2010
New Revision: 896998

URL: http://svn.apache.org/viewvc?rev=896998&view=rev
Log:
Merged revisions 896996 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.2.x-fixes

................
  r896996 | dkulp | 2010-01-07 15:16:19 -0500 (Thu, 07 Jan 2010) | 11 lines
  
  Merged revisions 896994 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r896994 | dkulp | 2010-01-07 15:13:45 -0500 (Thu, 07 Jan 2010) | 3 lines
    
    There is a potential problem if the workqueue drops to 0 threads, the
    THreadGroup gets destroyed and no more work can be added.   Make sure
    the threads are daemons, but the group is not to prevent it.
  ........
................

Modified:
    cxf/branches/2.1.x-fixes/   (props changed)
    cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan  7 20:18:11 2010
@@ -1,2 +1,2 @@
-/cxf/branches/2.2.x-fixes:896251
-/cxf/trunk:896248
+/cxf/branches/2.2.x-fixes:896251,896996
+/cxf/trunk:896248,896994

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

Modified: cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java?rev=896998&r1=896997&r2=896998&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java (original)
+++ cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java Thu Jan  7 20:18:11 2010
@@ -144,7 +144,6 @@
         } catch (SecurityException e) { 
             group = new ThreadGroup(name + "-workqueue");
         }
-        group.setDaemon(true);
         return new AWQThreadFactory(group, name);
     }
     static class AWQThreadFactory implements ThreadFactory {
@@ -159,14 +158,15 @@
             loader = AutomaticWorkQueueImpl.class.getClassLoader();
         }
         public Thread newThread(Runnable r) {
+            if (group.isDestroyed()) {
+                group = new ThreadGroup(group.getParent(), name + "-workqueue");
+            }
             Thread t = new Thread(group, 
                                   r, 
                                   name + "-workqueue-" + threadNumber.getAndIncrement(),
                                   0);
             t.setContextClassLoader(loader);
-            if (!t.isDaemon()) {
-                t.setDaemon(true);
-            }
+            t.setDaemon(true);
             if (t.getPriority() != Thread.NORM_PRIORITY) {
                 t.setPriority(Thread.NORM_PRIORITY);
             }