Author: dkulp
Date: Thu Jan 7 20:16:19 2010
New Revision: 896996
URL: http://svn.apache.org/viewvc?rev=896996&view=rev
Log:
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.2.x-fixes/ (props changed)
cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java
Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan 7 20:16:19 2010
@@ -1 +1 @@
-/cxf/trunk:896888
+/cxf/trunk:896888,896994
Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java?rev=896996&r1=896995&r2=896996&view=diff
==============================================================================
---
cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java
(original)
+++
cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java
Thu Jan 7 20:16:19 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);
}