Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#300 waitForIdle can time out with Java 1.7

closed
5
2012-01-26
2012-01-19
Anonymous
No

Our application uses a local event queue which is pushed onto the stack at startup. Now waitForIdle in Robot.java waits for all known queues to be empty and this works fine in Java 1.6.

Unfortunately the Java 1.7 version of EventQueue.push sticks an invocation event onto the current queue before switching to the new queue:

// Wake up EDT waiting in getNextEvent(), so it can
// pick up a new EventQueue. Post the waking event before
// topQueue.nextQueue is assigned, otherwise the event would
// go newEventQueue
topQueue.postEventPrivate(new InvocationEvent(topQueue, dummyRunnable));

So this invocation event enters the old queue and is never removed – hence waitForIdle always times out because a queue never becomes empty.

Discussion

  • Gerard Davison
    Gerard Davison
    2012-01-19

    • assigned_to: twall --> gdavison
     
  • Gerard Davison
    Gerard Davison
    2012-01-26

    Fixed in 2815

     
  • Gerard Davison
    Gerard Davison
    2012-01-26

    • status: open --> closed