mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-04 21:40:16 +08:00
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
This commit is contained in:
parent
f18be892cb
commit
6fdab8ccdb
@ -1,3 +1,8 @@
|
|||||||
|
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>
|
2004-01-19 Fernando Nasser <fnasser@redhat.com>
|
||||||
|
|
||||||
* java/awt/EventQueue.java (pop): Prevent racing condition to add
|
* java/awt/EventQueue.java (pop): Prevent racing condition to add
|
||||||
|
@ -231,10 +231,11 @@ public class EventQueue
|
|||||||
public static void invokeAndWait(Runnable runnable)
|
public static void invokeAndWait(Runnable runnable)
|
||||||
throws InterruptedException, InvocationTargetException
|
throws InterruptedException, InvocationTargetException
|
||||||
{
|
{
|
||||||
|
if (isDispatchThread ())
|
||||||
|
throw new Error("Can't call invokeAndWait from event dispatch thread");
|
||||||
|
|
||||||
EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue();
|
EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue();
|
||||||
Thread current = Thread.currentThread();
|
Thread current = Thread.currentThread();
|
||||||
if (current == eq.dispatchThread)
|
|
||||||
throw new Error("Can't call invokeAndWait from event dispatch thread");
|
|
||||||
|
|
||||||
InvocationEvent ie =
|
InvocationEvent ie =
|
||||||
new InvocationEvent(eq, runnable, current, true);
|
new InvocationEvent(eq, runnable, current, true);
|
||||||
|
Loading…
Reference in New Issue
Block a user