summaryrefslogtreecommitdiffstats
path: root/libjava
diff options
context:
space:
mode:
authorfnasser <fnasser@138bc75d-0d04-0410-961f-82ee72b054a4>2004-01-13 22:51:26 +0000
committerfnasser <fnasser@138bc75d-0d04-0410-961f-82ee72b054a4>2004-01-13 22:51:26 +0000
commit6c74b72ea547ac65e0458469eb9e9e8c9087c5cb (patch)
tree19d5d70344d911775cbe074ab49d8a1022a329f7 /libjava
parenta79e17014986fc6a08417f49585f00270c76fa69 (diff)
downloadppe42-gcc-6c74b72ea547ac65e0458469eb9e9e8c9087c5cb.tar.gz
ppe42-gcc-6c74b72ea547ac65e0458469eb9e9e8c9087c5cb.zip
* java/awt/EventQueue.java (isDispatchThread): Do check on top of stack. (push): Make sure push is performed at the top of the thread stack.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@75820 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog7
-rw-r--r--libjava/java/awt/EventQueue.java18
2 files changed, 22 insertions, 3 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index ea7d4adef8e..b771b1f69a0 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,8 @@
+2004-01-13 Fernando Nasser <fnasser@redhat.com>
+
+ * java/awt/EventQueue.java (isDispatchThread): Do check on top of stack.
+ (push): Make sure push is performed at the top of the thread stack.
+
2004-01-13 Thomas Fitzsimmons <fitzsim@redhat.com>
* gnu/java/awt/peer/gtk/GtkTextAreaPeer.java,
@@ -47,7 +52,7 @@
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c (gtkInit):
Update postConfigureEvent signature.
-2004-01-12 Fernando Nasser <fnasser@redhat.com>
+2004-01-13 Fernando Nasser <fnasser@redhat.com>
* gnu/java/awt/peer/gtk/TestAWT.java (DialogWindow): Add WindowAdapter
to handle Window "Closing" events.
diff --git a/libjava/java/awt/EventQueue.java b/libjava/java/awt/EventQueue.java
index 45dc9713b6e..d20edbc13b0 100644
--- a/libjava/java/awt/EventQueue.java
+++ b/libjava/java/awt/EventQueue.java
@@ -269,12 +269,17 @@ public class EventQueue
}
/**
- * Return true if the current thread is the AWT event dispatch
+ * Return true if the current thread is the current AWT event dispatch
* thread.
*/
public static boolean isDispatchThread()
{
- EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue();
+ EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue();
+
+ /* Find last EventQueue in chain */
+ while (eq.next != null)
+ eq = eq.next;
+
return (Thread.currentThread() == eq.dispatchThread);
}
@@ -306,6 +311,15 @@ public class EventQueue
if (newEventQueue == null)
throw new NullPointerException ();
+ /* Make sure we are at the top of the stack because callers can
+ only get a reference to the one at the bottom using
+ Toolkit.getDefaultToolkit().getSystemEventQueue() */
+ if (next != null)
+ {
+ next.push (newEventQueue);
+ return;
+ }
+
int i = next_out;
while (i != next_in)
{
OpenPOWER on IntegriCloud