db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r681104 - in /db/derby/code/trunk/java/engine/org/apache/derby/impl/services: daemon/SingleThreadDaemonFactory.java monitor/BaseMonitor.java
Date Wed, 30 Jul 2008 16:17:23 GMT
Author: kmarsden
Date: Wed Jul 30 09:17:23 2008
New Revision: 681104

URL: http://svn.apache.org/viewvc?rev=681104&view=rev
Log:
DERBY-3803 fix 'org.apache.derbyTesting.functionTests.tests.lang.XMLTypeAndOpsTest' failures
after checkin for DERBY-3745


Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/services/daemon/SingleThreadDaemonFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/daemon/SingleThreadDaemonFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/daemon/SingleThreadDaemonFactory.java?rev=681104&r1=681103&r2=681104&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/daemon/SingleThreadDaemonFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/daemon/SingleThreadDaemonFactory.java
Wed Jul 30 09:17:23 2008
@@ -26,6 +26,7 @@
 import org.apache.derby.iapi.services.daemon.DaemonService;
 import org.apache.derby.impl.services.daemon.BasicDaemon;
 import org.apache.derby.iapi.services.monitor.Monitor;
+import org.apache.derby.iapi.util.PrivilegedThreadOps;
 
 public class SingleThreadDaemonFactory implements DaemonFactory
 {
@@ -46,6 +47,12 @@
 		BasicDaemon daemon = new BasicDaemon(contextService);
 
 		Thread daemonThread = Monitor.getMonitor().getDaemonThread(daemon, name, false);
+		// DERBY-3745.  setContextClassLoader for thread to null to avoid
+		// leaking class loaders.
+		PrivilegedThreadOps.setContextClassLoaderIfPrivileged(
+							  daemonThread, null);
+
+
 		daemonThread.start();
 		return daemon;
 	}

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java?rev=681104&r1=681103&r2=681104&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java
Wed Jul 30 09:17:23 2008
@@ -276,6 +276,11 @@
 		dontGC = new AntiGC(keepItems);
 
 		Thread dontGCthread = getDaemonThread(dontGC, "antiGC", true);
+		// DERBY-3745.  setContextClassLoader for thread to null to avoid
+		// leaking class loaders.
+		PrivilegedThreadOps.setContextClassLoaderIfPrivileged(
+						dontGCthread, null);
+
 		dontGCthread.start();
 
 		if (SanityManager.DEBUG) {
@@ -2080,11 +2085,6 @@
 
 	public Thread getDaemonThread(Runnable task, String name, boolean setMinPriority) {
 		Thread t =  new Thread(daemonGroup, task, "derby.".concat(name));
-		// DERBY-3745.  setContextClassLoader for thread to null to avoid
-		// leaking class loaders.
-		PrivilegedThreadOps.setContextClassLoaderIfPrivileged(
-							  t, null);
-
 		t.setDaemon(true);
 
 		if (setMinPriority) {



Mime
View raw message