db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r1234973 - /db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/services/daemon/IndexStatisticsDaemonImpl.java
Date Mon, 23 Jan 2012 20:31:20 GMT
Author: kmarsden
Date: Mon Jan 23 20:31:19 2012
New Revision: 1234973

URL: http://svn.apache.org/viewvc?rev=1234973&view=rev
Log:
DERBY-5582 Access denied (java.lang.RuntimePermission modifyThreadGroup) in IndexStatisticsDaemonImpl.schedule

Use Derby daemon thread and thread group.


Modified:
    db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/services/daemon/IndexStatisticsDaemonImpl.java

Modified: db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/services/daemon/IndexStatisticsDaemonImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/services/daemon/IndexStatisticsDaemonImpl.java?rev=1234973&r1=1234972&r2=1234973&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/services/daemon/IndexStatisticsDaemonImpl.java
(original)
+++ db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/services/daemon/IndexStatisticsDaemonImpl.java
Mon Jan 23 20:31:19 2012
@@ -39,6 +39,7 @@ import org.apache.derby.iapi.services.pr
 import org.apache.derby.iapi.services.sanity.SanityManager;
 import org.apache.derby.iapi.services.stream.HeaderPrintWriter;
 import org.apache.derby.iapi.services.uuid.UUIDFactory;
+import org.apache.derby.iapi.services.monitor.Monitor;
 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
 import org.apache.derby.iapi.sql.depend.DependencyManager;
 import org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor;
@@ -247,10 +248,9 @@ public class IndexStatisticsDaemonImpl
                         " (queueSize=" + queue.size() + ")");
                 // If we're idle, fire off the worker thread.
                 if (runningThread == null) {
-                    runningThread = new Thread(this, "index-stat-thread");
-                    // Make the thread a daemon thread, we don't want it to stop
-                    // the JVM from exiting. This is a precaution.
-                    runningThread.setDaemon(true);
+                    //DERBY-5582. Make sure the thread is in the derby group
+                    // to avoid potential security manager issues
+                    runningThread = Monitor.getMonitor().getDaemonThread(this, "index-stat-thread",
false);
                     runningThread.start();
                 }
             }



Mime
View raw message