remm        2003/07/28 04:23:57

  Modified:    util/java/org/apache/tomcat/util/threads ThreadPool.java
  Log:
  - Beautify the thread names.
  
  Revision  Changes    Path
  1.12      +20 -2     
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/threads/ThreadPool.java
  
  Index: ThreadPool.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/threads/ThreadPool.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ThreadPool.java   3 Apr 2003 00:51:44 -0000       1.11
  +++ ThreadPool.java   28 Jul 2003 11:23:56 -0000      1.12
  @@ -133,7 +133,12 @@
   
       /** Name of the threadpool
        */
  -    protected String name=null;
  +    protected String name = "TP";
  +
  +    /**
  +     * Sequence.
  +     */
  +    protected int sequence = 1;
   
       /**
        * Helper object for logging
  @@ -240,6 +245,18 @@
           return isDaemon;
       }
   
  +    public void setName(String name) {
  +        this.name = name;
  +    }
  +
  +    public String getName() {
  +        return name;
  +    }
  +
  +    public int getSequence() {
  +        return sequence++;
  +    }
  +
       public void addThread( Thread t, ControlRunnable cr ) {
           threads.put( t, cr );
           for( int i=0; i<listeners.size(); i++ ) {
  @@ -499,7 +516,7 @@
               shouldTerminate = false;
               t = new Thread(this);
               t.setDaemon(p.getDaemon() );
  -         t.setName( "MonitorRunnable" );
  +         t.setName(p.getName() + "-Monitor");
               t.start();
           }
   
  @@ -592,6 +609,7 @@
               this.p = p;
               t = new ThreadWithAttributes(p, this);
               t.setDaemon(true);
  +            t.setName(p.getName() + "-Processor" + p.getSequence());
               t.start();
               p.addThread( t, this );
            noThData=true;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to