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:
committed by
Fernando Nasser
parent
f18be892cb
commit
6fdab8ccdb
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user