You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2021/01/20 10:07:54 UTC

[GitHub] [activemq-nms-openwire] michaelpearce-gain commented on a change in pull request #12: Implemented necessary signaling for Shutdown() and ShutDownWithAbort()

michaelpearce-gain commented on a change in pull request #12:
URL: https://github.com/apache/activemq-nms-openwire/pull/12#discussion_r560837334



##########
File path: src/Threads/PooledTaskRunner.cs
##########
@@ -106,34 +106,34 @@ public void Shutdown(TimeSpan timeout)
 				{
 					if(iterating)
 					{
-						System.Threading.Thread.Sleep(timeout);
+						Monitor.Wait(runable, timeout);
 					}
 				}
 			}
 		}
 
-        public void ShutdownWithAbort(TimeSpan timeout)
+    public void ShutdownWithAbort(TimeSpan timeout)
+    {
+      lock(runable)
+      {
+        _shutdown = true;
+
+        if (runningThread != Thread.CurrentThread)
         {
-            lock(runable)
-            {
-                _shutdown = true;
-
-                if (runningThread != Thread.CurrentThread)
-                {
-                    if(iterating)
-                    {
-                        Thread.Sleep(timeout);
-                    }
-
-                    if(iterating)
-                    {
-                        runningThread.Abort();
+          if(iterating)
+          {
+						Monitor.Wait(runable, timeout);

Review comment:
       formatting seems to a bit over the place




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org