- 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:
parent
3a55c1b270
commit
70edf7bedf
1 changed files with 2 additions and 6 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue