Change WaitingThread class to unblock the lock instead of interrupting the waiting thread

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@649217 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Oleg Kalnichevski 2008-04-17 18:32:32 +00:00
parent ad9e79c4d9
commit d3205ff522
1 changed files with 4 additions and 4 deletions

View File

@ -147,7 +147,7 @@ public class WaitingThread {
} }
if (aborted) if (aborted)
throw new InterruptedException("interrupted already"); throw new InterruptedException("Operation interrupted");
this.waiter = Thread.currentThread(); this.waiter = Thread.currentThread();
@ -159,6 +159,8 @@ public class WaitingThread {
this.cond.await(); this.cond.await();
success = true; success = true;
} }
if (aborted)
throw new InterruptedException("Operation interrupted");
} finally { } finally {
this.waiter = null; this.waiter = null;
} }
@ -188,9 +190,7 @@ public class WaitingThread {
public void interrupt() { public void interrupt() {
aborted = true; aborted = true;
this.cond.signalAll();
if (this.waiter != null)
this.waiter.interrupt();
} }