The alarm queue threads were started with an empty task body, which
meant the thread started and terminated immediately, leaving the
queue itself with no worker.
Change-Id: I2a9b5fe9c2bdff4a5e0f7ec7ad41a54b41a4ddd6
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
int threads = 1;
alarmQueue = new ScheduledThreadPoolExecutor(threads,
new ThreadFactory() {
+ private final ThreadFactory baseFactory = Executors
+ .defaultThreadFactory();
+
public Thread newThread(Runnable taskBody) {
- Thread thr = new Thread("JGit-AlarmQueue");
+ Thread thr = baseFactory.newThread(taskBody);
+ thr.setName("JGit-AlarmQueue");
thr.setDaemon(true);
return thr;
}
});
- alarmQueue.allowCoreThreadTimeOut(false);
alarmQueue.setMaximumPoolSize(alarmQueue.getCorePoolSize());
alarmQueue.setContinueExistingPeriodicTasksAfterShutdownPolicy(false);
alarmQueue.setExecuteExistingDelayedTasksAfterShutdownPolicy(false);