to improve diagnosability, set the thread name to indicate what it's polling.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@15209 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2009-02-10 22:40:56 +00:00
1 parent 04951d8e60
commit 8eb167ba43
1 file changed
+4
@@ -417,6 +417,8 @@ public class SCMTrigger extends Trigger<SCMedItem> {
}
public void run() {
String threadName = Thread.currentThread().getName();
Thread.currentThread().setName("SCM polling for "+job);
try {
while(pollingScheduled) {
getLock().lockInterruptibly();
@@ -447,6 +449,8 @@ public class SCMTrigger extends Trigger<SCMedItem> {
}
} catch (InterruptedException e) {
LOGGER.info("Aborted");
} finally {
Thread.currentThread().setName(threadName);
}
}
}