Interrupted attempt to acquire write lock

I'm getting an error thrown:Error - Interrupted attempt to aquire (sic) write lockI assume this is because I am interrupting the thread while it is trying to acquire a lock on some synchronized object. How can I avoid this?It seems really problematic.
[287 byte] By [turingcomplete] at [2007-9-26 2:25:28]
# 1
I do not think this is a normal error. Have you look through the bugs, to make sure it is not a bug with the JVM.
scottcoleman1973 at 2007-6-29 9:36:36 > top of Java-index,Core,Core APIs...
# 2

I haven't been able to find anything on this anywhere, even in the bug database.

It may have something to do with the fact that I'm updating a swing component outside of the event dispatch thread. I just discovered the importance of SwingUtilities...

It's interesting that it works 99.9% of the time. Hopefully when I rewrite the code this wont pop up again.

turingcomplete at 2007-6-29 9:36:36 > top of Java-index,Core,Core APIs...
# 3

Hi,

have you solved the problem concerning the "interrupted attempt..."? I get the same error - in a similar situation. My program is also multi-threaded and I'm trying to set new values for some UI elements in a different thread. My program works most of the time, too...

Thanks in advance,

Nicolas

nicolas.heess at 2007-6-29 9:36:36 > top of Java-index,Core,Core APIs...
# 4

You should make sure that all observers are notified of one update before making any futher modifications. Using the interface incorrectly would possibly yield "interrupted attempt..." error. This probably happens when two successive modifications happen "fast enough".

Best, Eran

-

"[an AbstractDocument]....allows multiple readers or one writer, and writers must wait until

all observers of the document have been notified of a previous change before beginning another mutation to the document. The read lock is aquired and released using the render

method. A write lock is aquired by the methods that mutate the document, and are held for the duration of the method call. Notification is done on the thread that produced the mutation,

and the thread has full read access to the document for the duration of the notification, but other readers are kept out until the notification has finished. The notification is a beans event notification which does not allow any further mutations until all listeners have been notified." (AbstractDocument documentation)

yahav at 2007-6-29 9:36:36 > top of Java-index,Core,Core APIs...
# 5
Could you tell how to solve this problem in more detail? Yunfzhang@utstar.com Thanks!
zhangyf2 at 2007-6-29 9:36:36 > top of Java-index,Core,Core APIs...
# 6
I think in your case you should look at this: http://java.sun.com/products/jfc/tsc/articles/threads/threads2.htmlSpecifically, Example1.updateStatus() shows how to update the GUI from another thread.
ryleyb666 at 2007-6-29 9:36:36 > top of Java-index,Core,Core APIs...