xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Greg Steele" <gste...@apt-cafm.com>
Subject SwingWorker and invokeAndWait
Date Thu, 22 Dec 2005 22:17:20 GMT
Hello,
My app needs to update a database and the canvas for some functions.  I've
tried code similiar to that below, but I've had the event dispatch thread
deadlock.  I thought I'd be safe using invokeAndWait within a SwingWorker.
Is this a thread safe operation?

Thanks,
Greg


SwingWorker worker = new SwingWorker(){
	public Object construct(){
		//start database transaction

      	canvas.getUpdateManager().getUpdateRunnableQueue().invokeAndWait(new
Runnable(){
            	public void run(){
                  	//perform some dom updates
            	}
        	});

		//commit database transaction
      }

	public void finished(){
         update.dispose();
      }
};
worker.start();



---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Mime
View raw message