activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r893614 - /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/InactivityMonitor.cs
Date Wed, 23 Dec 2009 19:49:12 GMT
Author: tabish
Date: Wed Dec 23 19:49:11 2009
New Revision: 893614

URL: http://svn.apache.org/viewvc?rev=893614&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQNET-212

Timeout in the StopMonitorThreads methods when waiting for the Timers to be Disposed so we
don't block forever.

Modified:
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/InactivityMonitor.cs

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/InactivityMonitor.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/InactivityMonitor.cs?rev=893614&r1=893613&r2=893614&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/InactivityMonitor.cs
(original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/InactivityMonitor.cs
Wed Dec 23 19:49:11 2009
@@ -345,11 +345,13 @@
                 {
                     AutoResetEvent shutdownEvent = new AutoResetEvent(false);
 
+                    // Attempt to wait for the Timers to shutdown, but don't wait
+                    // forever, if they don't shutdown after two seconds, just quit.
                     this.readCheckTimer.Dispose(shutdownEvent);
-                    shutdownEvent.WaitOne();
+                    shutdownEvent.WaitOne(TimeSpan.FromMilliseconds(2000));
                     this.writeCheckTimer.Dispose(shutdownEvent);
-                    shutdownEvent.WaitOne();
-
+                    shutdownEvent.WaitOne(TimeSpan.FromMilliseconds(2000));
+                    
 					this.asyncTasks.Shutdown();
                     this.asyncTasks = null;
                     this.asyncWriteTask = null;



Mime
View raw message