From d3205ff522fd52d2bc2a907393cb6fd22e2ddc0a Mon Sep 17 00:00:00 2001 From: Oleg Kalnichevski Date: Thu, 17 Apr 2008 18:32:32 +0000 Subject: [PATCH] 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 --- .../org/apache/http/impl/conn/tsccm/WaitingThread.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/module-client/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThread.java b/module-client/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThread.java index fafc18d9c..af3845257 100644 --- a/module-client/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThread.java +++ b/module-client/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThread.java @@ -147,7 +147,7 @@ public class WaitingThread { } if (aborted) - throw new InterruptedException("interrupted already"); + throw new InterruptedException("Operation interrupted"); this.waiter = Thread.currentThread(); @@ -159,6 +159,8 @@ public class WaitingThread { this.cond.await(); success = true; } + if (aborted) + throw new InterruptedException("Operation interrupted"); } finally { this.waiter = null; } @@ -188,9 +190,7 @@ public class WaitingThread { public void interrupt() { aborted = true; - - if (this.waiter != null) - this.waiter.interrupt(); + this.cond.signalAll(); }