]> source.dussan.org Git - jgit.git/commitdiff
Paper bag fix BatchingProgressMonitor alarm queue 17/2617/1
authorShawn O. Pearce <spearce@spearce.org>
Tue, 1 Mar 2011 18:06:39 +0000 (10:06 -0800)
committerShawn O. Pearce <spearce@spearce.org>
Tue, 1 Mar 2011 18:07:08 +0000 (10:07 -0800)
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>
org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchingProgressMonitor.java

index 5eb959752b87ad8380b62b5cdcf6c17fc5ac7b7e..bae6166227ba45e070234f185a62a07d39c42a0f 100644 (file)
@@ -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);