need to own lock to notify
authorjprocter <Jim Procter>
Mon, 17 Jan 2011 14:48:52 +0000 (14:48 +0000)
committerjprocter <Jim Procter>
Mon, 17 Jan 2011 14:48:52 +0000 (14:48 +0000)
src/jalview/javascript/JSFunctionExec.java

index 9c6f578..47e4538 100644 (file)
@@ -24,10 +24,13 @@ public class JSFunctionExec implements Runnable
   {
     if (jsExecQueue != null)
     {
-      Vector q = jsExecQueue;
-      jsExecQueue = null;
-      q.removeAllElements();
-      executor.notify();
+      synchronized (jsExecQueue)
+      {
+        Vector q = jsExecQueue;
+        q.removeAllElements();
+        jsExecQueue = null;
+        executor.notify();
+      }
       executor = null;
     }
   }