tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <Chuck.Caldar...@unisys.com>
Subject RE: Tomcat connection pool "bleeding" under heavy load
Date Tue, 19 Nov 2013 03:59:34 GMT
> From: David Bullock [mailto:david.bullock@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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message