2009-04-07 sponge
* SimpleTimer2, SimpleScheduler fixed so that the threads all run from The main threadgroup, not in the current possible child threadgroup. So long as any SimpleTimer2/SimpleScheduler is started *BEFORE* any child threadgroups, the constructors are threadgroup safe. What would be super cool is if they were to be all jailed within thier very own threadgroup too, but, I2P isn't up to the task of this yet. * Fixes to BOB to ensure the above is true.
This commit is contained in:
@ -34,6 +34,8 @@ import java.util.Properties;
|
||||
import net.i2p.client.I2PClient;
|
||||
import net.i2p.client.streaming.RetransmissionTimer;
|
||||
import net.i2p.util.Log;
|
||||
import net.i2p.util.SimpleScheduler;
|
||||
import net.i2p.util.SimpleTimer2;
|
||||
|
||||
/**
|
||||
* <span style="font-size:8px;font-family:courier;color:#EEEEEE;background-color:#000000">
|
||||
@ -159,9 +161,10 @@ public class BOB {
|
||||
// Set up all defaults to be passed forward to other threads.
|
||||
// Re-reading the config file in each thread is pretty damn stupid.
|
||||
String configLocation = System.getProperty(PROP_CONFIG_LOCATION, "bob.config");
|
||||
|
||||
// This is here just to ensure there is no interference with our threadgroups.
|
||||
RetransmissionTimer Y = RetransmissionTimer.getInstance();
|
||||
SimpleScheduler Y1 = SimpleScheduler.getInstance();
|
||||
SimpleTimer2 Y2 = SimpleTimer2.getInstance();
|
||||
i = Y.hashCode();
|
||||
|
||||
{
|
||||
|
@ -25,6 +25,7 @@ package net.i2p.BOB;
|
||||
|
||||
import net.i2p.client.streaming.RetransmissionTimer;
|
||||
import net.i2p.util.SimpleScheduler;
|
||||
import net.i2p.util.SimpleTimer2;
|
||||
/**
|
||||
* Start from command line
|
||||
*
|
||||
@ -39,10 +40,13 @@ public class Main {
|
||||
public static void main(String[] args) {
|
||||
// THINK THINK THINK THINK THINK THINK
|
||||
RetransmissionTimer Y = RetransmissionTimer.getInstance();
|
||||
// needs SimpleScheduler
|
||||
// no way to stop the scheduler?!?
|
||||
SimpleScheduler.getInstance();
|
||||
SimpleScheduler Y1 = SimpleScheduler.getInstance();
|
||||
SimpleTimer2 Y2 = SimpleTimer2.getInstance();
|
||||
|
||||
BOB.main(args);
|
||||
|
||||
Y2.stop();
|
||||
Y1.stop();
|
||||
Y.stop();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user