Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 12681 invoked from network); 17 Feb 2011 15:43:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Feb 2011 15:43:49 -0000 Received: (qmail 34875 invoked by uid 500); 17 Feb 2011 15:43:48 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 34550 invoked by uid 500); 17 Feb 2011 15:43:45 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 34538 invoked by uid 99); 17 Feb 2011 15:43:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Feb 2011 15:43:44 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Feb 2011 15:43:44 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 593D71AABAE for ; Thu, 17 Feb 2011 15:43:24 +0000 (UTC) Date: Thu, 17 Feb 2011 15:43:24 +0000 (UTC) From: "Dominik Stadler (JIRA)" To: issues@commons.apache.org Message-ID: <2074512545.3012.1297957404346.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] Created: (EXEC-55) Set names for started threads MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Set names for started threads ----------------------------- Key: EXEC-55 URL: https://issues.apache.org/jira/browse/EXEC-55 Project: Commons Exec Issue Type: Improvement Affects Versions: 1.1 Reporter: Dominik Stadler Priority: Minor Currently some threads are started without names, this makes it harder to read thread dumps, especially in large applications with many threads. The following patch fixes this for the places that I could identify: ### Eclipse Workspace Patch 1.0 #P commons-exec-trunk Index: src/main/java/org/apache/commons/exec/DefaultExecutor.java =================================================================== --- src/main/java/org/apache/commons/exec/DefaultExecutor.java (revision 1071645) +++ src/main/java/org/apache/commons/exec/DefaultExecutor.java (working copy) @@ -181,7 +181,7 @@ throw new IOException(workingDirectory + " doesn't exist."); } - executorThread = new Thread() { + executorThread = new Thread("Default Executor") { public void run() { int exitValue = Executor.INVALID_EXITVALUE; try { Index: src/main/java/org/apache/commons/exec/PumpStreamHandler.java =================================================================== --- src/main/java/org/apache/commons/exec/PumpStreamHandler.java (revision 1071645) +++ src/main/java/org/apache/commons/exec/PumpStreamHandler.java (working copy) @@ -284,7 +284,7 @@ protected Thread createPump(final InputStream is, final OutputStream os, final boolean closeWhenExhausted) { final Thread result = new Thread(new StreamPumper(is, os, - closeWhenExhausted)); + closeWhenExhausted), "Stream Pumper"); result.setDaemon(true); return result; } @@ -300,7 +300,7 @@ */ private Thread createSystemInPump(InputStream is, OutputStream os) { inputStreamPumper = new InputStreamPumper(is, os); - final Thread result = new Thread(inputStreamPumper); + final Thread result = new Thread(inputStreamPumper, "Input Stream Pumper"); result.setDaemon(true); return result; } -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira