Problems with libjava's AWT
Bryce McKinlay
mckinlay@redhat.com
Wed Jun 16 19:22:00 GMT 2004
Bernd Schmidt wrote:
>At the very least, the patch I'm appending below seems necessary to
>leave "status" at 0 if imageUpdate is given a zero "flags". The program
>then gets a bit further, but it still hangs up in the same wait(). This
>seems to be a genuine deadlock: we have a thread running wait() inside
>a synchronized{} block, while another thread is running imageUpdate, trying
>to notify the other thread that it can stop waiting, but unable to enter
>the critical section (because the thread wait()ing has it blocked).
>>
Nope. wait() implicitly releases the lock when the wait begins, and
reaquires it before returning. I don't think there is a deadlock here.
I don't know if this is the same problem you are seeing, but here is a
patch I came up with to get another app working. The problem here is
that when using the Toolkit.createImage() methods, startProduction() is
never called on the GdkPixbufDecoder so no work is actually done. So, a
Mediatracker waiting for the image will simply wait forever.
2004年06月16日 Bryce McKinlay <mckinlay@redhat.com>
* gnu/java/awt/peer/gtk/GtkImage.java (GtkImage): Call
startProduction() on image producer.
Index: GtkImage.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/awt/peer/gtk/GtkImage.java,v
retrieving revision 1.5
diff -u -r1.5 GtkImage.java
--- GtkImage.java 27 May 2004 06:17:34 -0000 1.5
+++ GtkImage.java 16 Jun 2004 19:04:23 -0000
@@ -81,7 +81,7 @@
this.g = g;
if (source != null)
- source.addConsumer (this);
+ source.startProduction (this);
}
public void setObserver (ImageObserver observer)
Regards
Bryce
More information about the Java
mailing list