- No need to make runner volatile since it is only access in synchronized code

- Do not null out Logging.runner at the end of Runner.run()
- Remove unused Runner.wakeup() method and make runner.run() not synchronized
This commit is contained in:
hns 2005-06-09 11:02:55 +00:00
parent 3a55c1b270
commit 70edf7bedf

View file

@ -32,7 +32,7 @@ import java.util.*;
public class Logging extends LogFactory {
// we use one static thread for all Loggers
static volatile Runner runner;
static Runner runner;
// the list of active loggers
static ArrayList loggers = new ArrayList();
@ -233,7 +233,7 @@ public class Logging extends LogFactory {
*/
static class Runner extends Thread {
public synchronized void run() {
public void run() {
long nextMidnight = nextMidnight();
while ((runner == this) && !isInterrupted()) {
@ -272,12 +272,8 @@ public class Logging extends LogFactory {
break;
}
}
runner = null;
}
public synchronized void wakeup() {
notifyAll();
}
}
}