aboutsummaryrefslogtreecommitdiff
path: root/libjava/java
diff options
context:
space:
mode:
authorFernando Nasser <fnasser@redhat.com>2004-01-19 18:22:29 +0000
committerFernando Nasser <fnasser@gcc.gnu.org>2004-01-19 18:22:29 +0000
commit6fdab8ccdb27688b53e0b219482c9ee3de361e54 (patch)
treed91a518a1baa9883afe49a75862ee664baffe08d /libjava/java
parentf18be892cbd2d8fb0991c1779dab1120fc4c74b1 (diff)
downloadgcc-6fdab8ccdb27688b53e0b219482c9ee3de361e54.zip
gcc-6fdab8ccdb27688b53e0b219482c9ee3de361e54.tar.gz
gcc-6fdab8ccdb27688b53e0b219482c9ee3de361e54.tar.bz2
EventQueue.java (invokeAndWait): Use list-aware isDispatchThread method to replace wrong test condition.
* java/awt/EventQueue.java (invokeAndWait): Use list-aware isDispatchThread method to replace wrong test condition. From-SVN: r76165
Diffstat (limited to 'libjava/java')
-rw-r--r--libjava/java/awt/EventQueue.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/libjava/java/awt/EventQueue.java b/libjava/java/awt/EventQueue.java
index 7df40ed..5cdfa63 100644
--- a/libjava/java/awt/EventQueue.java
+++ b/libjava/java/awt/EventQueue.java
@@ -231,10 +231,11 @@ public class EventQueue
public static void invokeAndWait(Runnable runnable)
throws InterruptedException, InvocationTargetException
{
+ if (isDispatchThread ())
+ throw new Error("Can't call invokeAndWait from event dispatch thread");
+
EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue();
Thread current = Thread.currentThread();
- if (current == eq.dispatchThread)
- throw new Error("Can't call invokeAndWait from event dispatch thread");
InvocationEvent ie =
new InvocationEvent(eq, runnable, current, true);