improved timeout handling

git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@1252 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
Greg Wilkins 2010-02-09 11:38:25 +00:00
parent 083ef60f5e
commit ea14de47b7
2 changed files with 5 additions and 5 deletions

View File

@ -286,7 +286,8 @@ public class SelectChannelEndPoint extends ChannelEndPoint implements Runnable,
updateKey();
this.wait(timeoutMs);
if (_readBlocked && timeoutMs<(_selectSet.getNow()-start))
timeoutMs -= _selectSet.getNow()-start;
if (_readBlocked && timeoutMs<=0)
return false;
}
catch (InterruptedException e)
@ -323,7 +324,8 @@ public class SelectChannelEndPoint extends ChannelEndPoint implements Runnable,
updateKey();
this.wait(timeoutMs);
if (_writeBlocked && timeoutMs<(_selectSet.getNow()-start))
timeoutMs -= _selectSet.getNow()-start;
if (_writeBlocked && timeoutMs<=0)
return false;
}
catch (InterruptedException e)

View File

@ -377,9 +377,7 @@ public abstract class AbstractConnector extends HttpBuffers implements Connector
{
try{close();} catch(IOException e) {Log.warn(e);}
if (_threadPool==_server.getThreadPool())
_threadPool=null;
else if (_threadPool instanceof LifeCycle)
if (_threadPool!=_server.getThreadPool() && _threadPool instanceof LifeCycle)
((LifeCycle)_threadPool).stop();
super.doStop();