diff options
| -rw-r--r-- | libjava/ChangeLog | 5 | ||||
| -rw-r--r-- | libjava/java/awt/EventQueue.java | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 2b34a94..3c779dd 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,5 +1,10 @@ 2004-01-19 Fernando Nasser <fnasser@redhat.com> + * java/awt/EventQueue.java (invokeAndWait): Use list-aware + isDispatchThread method to replace wrong test condition. + +2004-01-19 Fernando Nasser <fnasser@redhat.com> + * java/awt/EventQueue.java (pop): Prevent racing condition to add events to the queue out of order by acquiring locks in the proper order and not by releasing one before acquiring the other. 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); |
