Tjorven Lauchardt wrote:

Hi,

I have a question about the invokeAndWair() method of RunnableQueue. This code:
getCanvas().getUpdateManager().getUpdateRunnableQueue().invokeAndWait(new NoRepaintRunnable() {
public void run() {...}
});
crashes every time into an IllegalStateException "Cannot be called from the RunnableQueue thread". Where do I have to search? Is the call of invokeAndWait itself wrong or where else could hide the error?

If you are already in the Update Manager's runnable queue you don't have to/can't call invokeAndWait, but you can just run your code. You can check if you are already in the Update Manager thread with:

   Runnable r = new NoRepaintRunnable() {
         ....
   }

   if (um.getUpdateRunnableQueue().getThread()==Thread.currentThread)
      r.run();
   else
      ...invokeLater(r);




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to