CVS update: JGroups/src/org/jgroups/util HashedTimingWheel.java

"Bela Ban" <[email protected]>
Newsgroups gmane.comp.java.javagroups.cvs
Message-ID <[email protected]>
  User: belaban 
  Date: 10/08/05 06:57:20

  Modified:    src/org/jgroups/util HashedTimingWheel.java
  Log:
  stop() now cancels all tasks
  
  Revision  Changes    Path
  1.4       +8 -1      JGroups/src/org/jgroups/util/HashedTimingWheel.java
  
  Index: HashedTimingWheel.java
  ===================================================================
  RCS file: /cvsroot/javagroups/JGroups/src/org/jgroups/util/HashedTimingWheel.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- HashedTimingWheel.java	5 Aug 2010 06:48:19 -0000	1.3
  +++ HashedTimingWheel.java	5 Aug 2010 06:57:20 -0000	1.4
  @@ -21,7 +21,7 @@
    * [1] http://www.cse.wustl.edu/~cdgill/courses/cs6874/TimingWheels.ppt
    *
    * @author Bela Ban
  - * @version $Id: HashedTimingWheel.java,v 1.3 2010/08/05 06:48:19 belaban Exp $
  + * @version $Id: HashedTimingWheel.java,v 1.4 2010/08/05 06:57:20 belaban Exp $
    */
   @Experimental @Unsupported
   public class HashedTimingWheel implements TimeScheduler, Runnable  {
  @@ -353,6 +353,13 @@
           lock.lock();
           try {
               running=false;
  +            for(List<MyTask> list: wheel) {
  +                if(!list.isEmpty()) {
  +                    for(MyTask task: list)
  +                        task.cancel(true);
  +                    list.clear();
  +                }
  +            }
           }
           finally {
               lock.unlock();
  
  
  

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.