> From: David Bullock [mailto:david.bull...@machaira.com.au] 
> Subject: Re: Tomcat connection pool "bleeding" under heavy load

> In PooledConnection#borrow(int,String,String) when handling
> InterruptedException, the code there does:

>    Thread.interrupted();//clear the flag, and bail out

> but if the comment is correct, then the code is wrong (should
> be Thread.isInterrupted()).

No, Thread.interrupted() is a static method that checks if the _current_ thread 
has been interrupted.  Calling Thread.isInterrupted() would be illegal, since 
that is an instance method, and is used primarily to determine if some other 
thread has been interrupted.  Also, the isInterrupted() method does not clear 
the interrupted flag for the target thread, whereas Thread.interrupted() does 
clear it for the current thread.

 - 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.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to