mx4j/src/core/mx4j/timer TimeQueue.java,1.3,1.4

Simone Bordet <[email protected]> Wed, 20 Oct 2004 16:55:39 +0000
Newsgroups gmane.comp.java.mx4j.cvs
Message-ID <[email protected]>
Update of /cvsroot/mx4j/mx4j/src/core/mx4j/timer
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17619/src/core/mx4j/timer

Modified Files:
	TimeQueue.java 
Log Message:
Added alternate constructor to make the thread daemon or not. Default constructor is now not daemon, it was before. Fixes bug #1050288.

Index: TimeQueue.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/core/mx4j/timer/TimeQueue.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** TimeQueue.java	4 Sep 2004 15:44:12 -0000	1.3
--- TimeQueue.java	20 Oct 2004 16:55:36 -0000	1.4
***************
*** 28,31 ****
--- 28,32 ----
     private volatile boolean running;
     private final ArrayList tasks;
+    private final boolean daemon;
  
     /**
***************
*** 34,38 ****
--- 35,48 ----
     public TimeQueue()
     {
+       this(false);
+    }
+ 
+    /**
+     * Creates a new TimeQueue that will set the thread daemon or not depending on the given argument
+     */
+    public TimeQueue(boolean daemon)
+    {
        tasks = new ArrayList();
+       this.daemon = daemon;
     }
  
***************
*** 51,55 ****
              running = true;
              thread = new Thread(new Loop(), "MBean Timer Notification Thread");
!             thread.setDaemon(true);
              thread.start();
           }
--- 61,65 ----
              running = true;
              thread = new Thread(new Loop(), "MBean Timer Notification Thread");
!             thread.setDaemon(daemon);
              thread.start();
           }



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl