Browse Source

Paper bag fix BatchingProgressMonitor alarm queue

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>
stable-0.12
Shawn O. Pearce 14 years ago
parent
commit
bf1b970de1
  1. 7
      org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchingProgressMonitor.java

7
org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchingProgressMonitor.java

@ -64,13 +64,16 @@ public abstract class BatchingProgressMonitor implements ProgressMonitor {
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);

Loading…
Cancel
Save