> From: David.Meldrum [mailto:david.meld...@verizon.net]
> Subject: Re: Extra Threads in background
> 
> I did not call the "destroy()" method because I though it was 
> deprecated and dangerous.

I believe Chris meant the ServletContextListener.contextDestroyed() method, not 
Thread.destroy(); the latter should never be used.

Your extra thread should not have to wake up more often to check the terminate 
flag; the code in your contextDestroyed() method should simply interrupt the 
extra thread, which will then wake up from its sleep() or wait() call.

As far as your having two instances of your extra thread running, your webapp 
might be getting deployed twice.  Poorly constructed server.xml and context.xml 
configs can easily cause this.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


Reply via email to