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 2009/06/30 21:38:45 UTC

svn commit: r789899 - /cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java

Author: dkulp
Date: Tue Jun 30 19:38:45 2009
New Revision: 789899

URL: http://svn.apache.org/viewvc?rev=789899&view=rev
Log:
[CXF-2277] Make the workqueue use daemon threads so apps will actuall
stop.

Modified:
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java?rev=789899&r1=789898&r2=789899&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java Tue Jun 30 19:38:45 2009
@@ -137,14 +137,14 @@
                             //ignore - if we get here, the "group" is as high as 
                             //the security manager will allow us to go.   Use that one.
                         }
-                        return new ThreadGroup(group, name + "-workqueue"); 
+                        return new ThreadGroup(group, name + "-workqueue");
                     } 
                 }
             );
         } catch (SecurityException e) { 
-            group = new ThreadGroup(name + "-workqueue"); 
+            group = new ThreadGroup(name + "-workqueue");
         }
-        
+        group.setDaemon(true);
         return new AWQThreadFactory(group, name);
     }
     static class AWQThreadFactory implements ThreadFactory {
@@ -164,8 +164,8 @@
                                   name + "-workqueue-" + threadNumber.getAndIncrement(),
                                   0);
             t.setContextClassLoader(loader);
-            if (t.isDaemon()) {
-                t.setDaemon(false);
+            if (!t.isDaemon()) {
+                t.setDaemon(true);
             }
             if (t.getPriority() != Thread.NORM_PRIORITY) {
                 t.setPriority(Thread.NORM_PRIORITY);