You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by pf...@apache.org on 2005/03/17 06:17:29 UTC

cvs commit: jakarta-tapestry/framework/src/org/apache/tapestry/util JanitorThread.java

pferraro    2005/03/16 21:17:29

  Modified:    framework/src/org/apache/tapestry/util Tag: branch-3-0
                        JanitorThread.java
  Log:
  Ensures that interupting the thread will always terminate the run() method
  TAPESTRY-230: Ignored interruptedException prevents Janitorthread termination.
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.5.2.2   +5 -8      jakarta-tapestry/framework/src/org/apache/tapestry/util/Attic/JanitorThread.java
  
  Index: JanitorThread.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/org/apache/tapestry/util/Attic/JanitorThread.java,v
  retrieving revision 1.5.2.1
  retrieving revision 1.5.2.2
  diff -u -r1.5.2.1 -r1.5.2.2
  --- JanitorThread.java	25 Jan 2005 00:02:42 -0000	1.5.2.1
  +++ JanitorThread.java	17 Mar 2005 05:17:29 -0000	1.5.2.2
  @@ -168,17 +168,15 @@
        * successful, or false if the thread was interrupted (and should shut down).
        */
   
  -    protected boolean waitForNextPass()
  +    protected void waitForNextPass()
       {
           try
           {
               sleep(interval);
  -
  -            return true;
           }
           catch (InterruptedException ex)
           {
  -            return false;
  +            interrupt();
           }
       }
   
  @@ -188,10 +186,9 @@
   
       public void run()
       {
  -        while (true)
  +        while (!isInterrupted())
           {
  -            if (!waitForNextPass())
  -                return;
  +            waitForNextPass();
   
               sweep();
           }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org