diff options
Diffstat (limited to 'devel/charva/files/patch-java_src_charva_awt_Window.java')
-rw-r--r-- | devel/charva/files/patch-java_src_charva_awt_Window.java | 112 |
1 files changed, 56 insertions, 56 deletions
diff --git a/devel/charva/files/patch-java_src_charva_awt_Window.java b/devel/charva/files/patch-java_src_charva_awt_Window.java index 41f18aa85c09..84178c37cda2 100644 --- a/devel/charva/files/patch-java_src_charva_awt_Window.java +++ b/devel/charva/files/patch-java_src_charva_awt_Window.java @@ -1,56 +1,56 @@ ---- java/src/charva/awt/Window.java.orig Mon Aug 14 17:38:56 2006 -+++ java/src/charva/awt/Window.java Mon Jan 29 09:39:30 2007 -@@ -156,13 +156,21 @@ public class Window
- */
- SyncQueue.getInstance().postEvent(new SyncEvent(this));
-
-- if (_dispatchThreadRunning)
-- run();
-- else {
-- _dispatchThreadRunning = true;
-- Thread dispatchThread = new Thread(this);
-- dispatchThread.setName("event dispatcher");
-- dispatchThread.start();
-+ if (_dispatchThread != null) {
-+ if (Thread.currentThread() == _dispatchThread) {
-+ // we are in the EDT, we must manage events
-+ run();
-+ } else {
-+ // we are not the EDT, let's wait for him to ask us to close
-+ synchronized (this) {
-+ while (!_windowClosed)
-+ try { wait(); } catch (InterruptedException e) { }
-+ }
-+ }
-+ } else {
-+ _dispatchThread = new Thread(this);
-+ _dispatchThread.setName("event dispatcher");
-+ _dispatchThread.start();
-
- /* If "charva.script.playback" is defined, we start up
- * a thread for playing back the script. Keys from both the
-@@ -270,7 +278,10 @@ public class Window
- */
- if (we.getID() == AWTEvent.WINDOW_CLOSING) {
-
-- we.getWindow()._windowClosed = true;
-+ synchronized (we.getWindow()) {
-+ we.getWindow()._windowClosed = true;
-+ we.getWindow().notify();
-+ }
-
- /* Remove this window from the list of those displayed,
- * and blank out the screen area where the window was
-@@ -407,10 +418,10 @@ public class Window
-
- private Window _owner;
- protected Toolkit _term;
-- private boolean _windowClosed = false;
-+ private volatile boolean _windowClosed = false;
-
- private Vector _windowListeners = null;
-
-- private static boolean _dispatchThreadRunning = false;
-+ private static Thread _dispatchThread = null;
-
- }
+--- java/src/charva/awt/Window.java.orig 2016-06-20 12:40:44 UTC ++++ java/src/charva/awt/Window.java +@@ -156,13 +156,21 @@ public class Window + */ + SyncQueue.getInstance().postEvent(new SyncEvent(this)); + +- if (_dispatchThreadRunning) +- run(); +- else { +- _dispatchThreadRunning = true; +- Thread dispatchThread = new Thread(this); +- dispatchThread.setName("event dispatcher"); +- dispatchThread.start(); ++ if (_dispatchThread != null) { ++ if (Thread.currentThread() == _dispatchThread) { ++ // we are in the EDT, we must manage events ++ run(); ++ } else { ++ // we are not the EDT, let's wait for him to ask us to close ++ synchronized (this) { ++ while (!_windowClosed) ++ try { wait(); } catch (InterruptedException e) { } ++ } ++ } ++ } else { ++ _dispatchThread = new Thread(this); ++ _dispatchThread.setName("event dispatcher"); ++ _dispatchThread.start(); + + /* If "charva.script.playback" is defined, we start up + * a thread for playing back the script. Keys from both the +@@ -270,7 +278,10 @@ public class Window + */ + if (we.getID() == AWTEvent.WINDOW_CLOSING) { + +- we.getWindow()._windowClosed = true; ++ synchronized (we.getWindow()) { ++ we.getWindow()._windowClosed = true; ++ we.getWindow().notify(); ++ } + + /* Remove this window from the list of those displayed, + * and blank out the screen area where the window was +@@ -407,10 +418,10 @@ public class Window + + private Window _owner; + protected Toolkit _term; +- private boolean _windowClosed = false; ++ private volatile boolean _windowClosed = false; + + private Vector _windowListeners = null; + +- private static boolean _dispatchThreadRunning = false; ++ private static Thread _dispatchThread = null; + + } |