hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r649217 - /httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThread.java
Date Thu, 17 Apr 2008 18:32:33 GMT
Author: olegk
Date: Thu Apr 17 11:32:32 2008
New Revision: 649217

URL: http://svn.apache.org/viewvc?rev=649217&view=rev
Log:
Change WaitingThread class to unblock the lock instead of interrupting the waiting thread


Modified:
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThread.java

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThread.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThread.java?rev=649217&r1=649216&r2=649217&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThread.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThread.java
Thu Apr 17 11:32:32 2008
@@ -147,7 +147,7 @@
         }
 
         if (aborted)
-            throw new InterruptedException("interrupted already");
+            throw new InterruptedException("Operation interrupted");
         
         this.waiter = Thread.currentThread();
 
@@ -159,6 +159,8 @@
                 this.cond.await();
                 success = true;
             }
+            if (aborted)
+                throw new InterruptedException("Operation interrupted");
         } finally {
             this.waiter = null;
         }
@@ -188,9 +190,7 @@
     
     public void interrupt() {
         aborted = true;
-        
-        if (this.waiter != null)
-            this.waiter.interrupt();
+        this.cond.signalAll();
     }
 
 



Mime
View raw message