You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by le...@apache.org on 2002/02/21 06:43:17 UTC

cvs commit: jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/monitor ActiveMonitor.java

leif        02/02/20 21:43:17

  Modified:    src/java/org/apache/avalon/excalibur/monitor
                        ActiveMonitor.java
  Log:
  Fix an IllegalArgumentException caused by a wait fime being set to
  a negative value.
  
  Revision  Changes    Path
  1.7       +4 -4      jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/monitor/ActiveMonitor.java
  
  Index: ActiveMonitor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/monitor/ActiveMonitor.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ActiveMonitor.java	15 Feb 2002 16:18:15 -0000	1.6
  +++ ActiveMonitor.java	21 Feb 2002 05:43:16 -0000	1.7
  @@ -38,7 +38,7 @@
    * </pre>
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  - * @version $Id: ActiveMonitor.java,v 1.6 2002/02/15 16:18:15 bloritsch Exp $
  + * @version $Id: ActiveMonitor.java,v 1.7 2002/02/21 05:43:16 leif Exp $
    */
   public final class ActiveMonitor extends AbstractLogEnabled
       implements Monitor, Startable, ThreadSafe, Configurable, Runnable
  @@ -171,12 +171,12 @@
           {
               long currentTestTime = System.currentTimeMillis();
               long sleepTillTime = currentTestTime + m_frequency;
  -
  -            while ( System.currentTimeMillis() < sleepTillTime )
  +            
  +            while ( ( currentTestTime = System.currentTimeMillis() ) < sleepTillTime )
               {
                   try
                   {
  -                    Thread.sleep( sleepTillTime - System.currentTimeMillis() );
  +                    Thread.sleep( sleepTillTime - currentTestTime );
                   }
                   catch ( InterruptedException e )
                   {
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>