From 402cdfdc298d3f81a8216ada8fa58c06666f49fc Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Fri, 17 Jun 2011 12:24:24 -0700 Subject: [PATCH] Be explicit about our Interval usage. In AuditLogger, we roll over the audit log on the Interval timer thread, which is dubious, because it could block, but introducing an Invoker thread here would require a ticket on a boat that sailed a long time ago. In the case of SerialExecutor, we're just doing Thread.kill() on the Interval timer thread, so that's fast enough. --- src/main/java/com/samskivert/util/AuditLogger.java | 2 +- src/main/java/com/samskivert/util/SerialExecutor.java | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/samskivert/util/AuditLogger.java b/src/main/java/com/samskivert/util/AuditLogger.java index e469df58..684e1df4 100644 --- a/src/main/java/com/samskivert/util/AuditLogger.java +++ b/src/main/java/com/samskivert/util/AuditLogger.java @@ -166,7 +166,7 @@ public class AuditLogger } /** The interval that rolls over the log file. */ - protected Interval _rollover = new Interval() { + protected Interval _rollover = new Interval(Interval.RUN_DIRECT) { @Override public void expired () { checkRollOver(); } diff --git a/src/main/java/com/samskivert/util/SerialExecutor.java b/src/main/java/com/samskivert/util/SerialExecutor.java index 7045d48f..58881d64 100644 --- a/src/main/java/com/samskivert/util/SerialExecutor.java +++ b/src/main/java/com/samskivert/util/SerialExecutor.java @@ -135,9 +135,8 @@ public class SerialExecutor final ExecutorThread thread = new ExecutorThread(task); thread.start(); - // start up a timer that will abort this thread after the specified - // timeout - new Interval() { + // start up a timer that will abort this thread after the specified timeout + new Interval(Interval.RUN_DIRECT) { @Override public void expired () { // this will NOOP if the task has already completed thread.abort();