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:
[email protected]


Reply via email to