Fixed possible deadlock in NXCSession.executeScript
authorVictor Kirhenshtein <victor@netxms.org>
Thu, 16 Jun 2016 14:43:57 +0000 (17:43 +0300)
committerVictor Kirhenshtein <victor@netxms.org>
Thu, 16 Jun 2016 14:43:57 +0000 (17:43 +0300)
src/java/client/netxms-client/src/main/java/org/netxms/client/NXCSession.java

index 9881f07..21934ae 100644 (file)
@@ -5379,12 +5379,15 @@ public class NXCSession
       waitForRCC(msg.getMessageId());
       synchronized(handler)
       {
       waitForRCC(msg.getMessageId());
       synchronized(handler)
       {
-         try
-         {
-            handler.wait();
-         }
-         catch(InterruptedException e)
+         if (!handler.isComplete())
          {
          {
+            try
+            {
+               handler.wait();
+            }
+            catch(InterruptedException e)
+            {
+            }
          }
       }
       if (handler.isTimeout())
          }
       }
       if (handler.isTimeout())