You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Reinhard Brandstädter <r....@gmx.at> on 2003/10/16 13:40:09 UTC
when does InvokeAndWait() return?
Hi!
I've tried to use the invokeAndWait() method of the RunnableQueue to
replace the invokeLater() call. I only expected the SVG canvas to be
updated after each call before I append another element to the doc.
But the invokeAndWait() never returns, neither any exceptions are thrown!
----------
try {
System.out.print("adding element to the runnable queue..");
jSVGCanvas.getUpdateManager().getUpdateRunnableQueue().
invokeAndWait(new Runnable() {
public void run() {
doc.getRootElement().appendChild(gelem);
}
});
System.out.println("..done");
}
catch (DOMException ex) {}
catch (InterruptedException ex) {}
----------
Under which circumstances can you use invokeAndWait then?
Reinhard
--
Reinhard Brandstaedter r.brandstaedter@gmx.at GPG: 0x033B81DB
- Student of Computer Science - J.K. University of Linz -
- <ICQ: 73059068> <Mobile: +43 699 12419541> -
- http://adelaide.dnsalias.net -
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org
Re: when does InvokeAndWait() return?
Posted by Reinhard Brandstädter <r....@gmx.at>.
Thomas DeWeese wrote:
> You can use invokeAndWait from any thread other than the
> Swing thread.
I see, you better have to know that :-)
Reinhard
--
Reinhard Brandstaedter r.brandstaedter@gmx.at GPG: 0x033B81DB
- Student of Computer Science - J.K. University of Linz -
- <ICQ: 73059068> <Mobile: +43 699 12419541> -
- http://adelaide.dnsalias.net -
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org
Re: when does InvokeAndWait() return?
Posted by Thomas DeWeese <Th...@Kodak.com>.
Reinhard Brandstädter wrote:
> I've tried to use the invokeAndWait() method of the
> RunnableQueue to replace the invokeLater() call. I only
> expected the SVG canvas to be updated after each call before
> I append another element to the doc. But the invokeAndWait()
> never returns, neither any exceptions are thrown!
You are probably calling it from the Swing thread.
This is likely to cause a deadlock as in some cases it
needs to get information from the Swing component which
can only be done in the Swing thread (which you have
locked up!).
> Under which circumstances can you use invokeAndWait then?
You can use invokeAndWait from any thread other than the
Swing thread.
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org