avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject cvs commit: avalon-excalibur/event/src/java/org/apache/excalibur/event/command TPCThreadManager.java
Date Thu, 04 Sep 2003 18:12:10 GMT
bruno       2003/09/04 11:12:10

  Modified:    event/src/java/org/apache/excalibur/event/command
                        TPCThreadManager.java
  Log:
  * threads weren't interrupted during shutdown. Since these are non-daemon
    threads they prevent the jvm to exit
  * the warn message about the shutdown not finishing within sleeptime was
    printed in the wrong condition
  
  Revision  Changes    Path
  1.45      +8 -3      avalon-excalibur/event/src/java/org/apache/excalibur/event/command/TPCThreadManager.java
  
  Index: TPCThreadManager.java
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/event/src/java/org/apache/excalibur/event/command/TPCThreadManager.java,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- TPCThreadManager.java	4 Sep 2003 18:02:55 -0000	1.44
  +++ TPCThreadManager.java	4 Sep 2003 18:12:10 -0000	1.45
  @@ -183,14 +183,19 @@
               m_threadPool.shutdownAfterProcessingCurrentlyQueuedTasks();
           }
   
  +        m_threadPool.interruptAll();
  +
           try
           {
  -            m_threadPool.awaitTerminationAfterShutdown( getSleepTime() );
  +            if ( !m_threadPool.awaitTerminationAfterShutdown( getSleepTime() ) )
  +            {
  +                getLogger().warn("Thread pool took longer than " + getSleepTime() +
  +                     " ms to shut down");
  +            }
           }
           catch (InterruptedException ie)
           {
  -            getLogger().warn("Thread pool took longer than " + getSleepTime() +
  -                 " ms to shut down", ie);
  +            getLogger().warn("Thread pool was interrupted while waiting for shutdown to
complete.", ie);
           }
       }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message