Author: j16sdiz
Date: 2008-07-11 12:45:19 +0000 (Fri, 11 Jul 2008)
New Revision: 21049

Modified:
   
branches/saltedhashstore/freenet/src/freenet/store/saltedhash/SaltedHashFreenetStore.java
Log:
use NativeThread

Modified: 
branches/saltedhashstore/freenet/src/freenet/store/saltedhash/SaltedHashFreenetStore.java
===================================================================
--- 
branches/saltedhashstore/freenet/src/freenet/store/saltedhash/SaltedHashFreenetStore.java
   2008-07-11 12:45:00 UTC (rev 21048)
+++ 
branches/saltedhashstore/freenet/src/freenet/store/saltedhash/SaltedHashFreenetStore.java
   2008-07-11 12:45:19 UTC (rev 21049)
@@ -39,6 +39,7 @@
 import freenet.support.HexUtil;
 import freenet.support.Logger;
 import freenet.support.io.FileUtil;
+import freenet.support.io.NativeThread;

 /**
  * Index-less data store based on salted hash
@@ -868,20 +869,21 @@
                Entry process(Entry entry);
        }

-       private class Cleaner extends Thread {
+       private class Cleaner extends NativeThread {
                /**
                 * How often the clean should run
                 */
                private static final int CLEANER_PERIOD = 5 * 60 * 1000; // 5 
minutes

                public Cleaner() {
-                       setName("Store-" + name + "-Cleaner");
+                       super("Store-" + name + "-Cleaner", 
NativeThread.LOW_PRIORITY, false);
                        setPriority(MIN_PRIORITY);
                        setDaemon(true);
                }

                @Override
                public void run() {
+                       super.run();
                        try {
                                Thread.sleep((int)(CLEANER_PERIOD / 2 + 
CLEANER_PERIOD * Math.random()));
                        } catch (InterruptedException e){}


Reply via email to