You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2009/12/23 20:49:12 UTC
svn commit: r893614 -
/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/InactivityMonitor.cs
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;