activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r559092 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq: broker/TransportConnector.java thread/DedicatedTaskRunner.java
Date Tue, 24 Jul 2007 16:19:48 GMT
Author: chirino
Date: Tue Jul 24 09:19:43 2007
New Revision: 559092

URL: http://svn.apache.org/viewvc?view=rev&rev=559092
Log:
Fix for AMQ-1340 - Thread gets stuck in a WAIT and never returns

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnector.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/thread/DedicatedTaskRunner.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnector.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnector.java?view=diff&rev=559092&r1=559091&r2=559092
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnector.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnector.java
Tue Jul 24 09:19:43 2007
@@ -146,7 +146,7 @@
             public void onAccept(final Transport transport) {
                 try {
                 	// Starting the connection could block due to 
-                	// wireformat negociation, so start it in an async thread.
+                	// wireformat negotiation, so start it in an async thread.
                 	Thread startThread = new Thread("ActiveMQ Transport Initiator: "+transport.getRemoteAddress())
{
                 		public void run() {
                             try {

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/thread/DedicatedTaskRunner.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/thread/DedicatedTaskRunner.java?view=diff&rev=559092&r1=559091&r2=559092
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/thread/DedicatedTaskRunner.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/thread/DedicatedTaskRunner.java
Tue Jul 24 09:19:43 2007
@@ -67,8 +67,9 @@
             pending=true;
             mutex.notifyAll();
 
-            // Wait till the thread stops.
-            if(!threadTerminated){
+            // Wait till the thread stops ( no need to wait if shutdown 
+            // is called from thread that is shutting down) 
+            if( Thread.currentThread()!=thread && !threadTerminated ){
                 mutex.wait(timeout);
             }
         }
@@ -97,6 +98,9 @@
                 if( !task.iterate() ) {
                     // wait to be notified.
                     synchronized (mutex) {
+                        if( shutdown ) {
+                            return;
+                        }
                         while( !pending ) {
                             mutex.wait();
                         }



Mime
View raw message