[gui] [PATCH] Fixes to MemoryImageSource

David Jee djee@redhat.com
Tue Jul 13 23:27:00 GMT 2004


Hello,

I committed the following patch to the java-gui-branch.  It mainly
reimplements the private field "consumers" using Vector instead of
Hashtable.  This is because enumeration on Hashtable is not thread-safe,
and can have unexpected behaviour if the underlying Hashtable is changed
while we're enumerating through it.  With a couple other small fixes
that are included, this patch makes sure that calling imageComplete() on
the image consumers will behave correctly.

-David Jee

2004-07-12  David Jee  <djee@redhat.com>

        * gnu/java/awt/peer/gtk/GtkImagePainter.java
        (imageComplete): Call image.imageComplete().
        * java/awt/image/MemoryImageSource.java:
        Reimplement consumers as a Vector instead of a Hashtable.  This is
        because enumeration on a Hashtable is not thread-safe.
        (addConsumer): Adapt to Vector consumers.
        (isConsumer): Adapt to Vector consumers.
        (removeConsumer): Adapt to Vector consumers.
        (startProduction): Adapt to Vector consumers. Call imageComplete()
        with STATICIMAGEDONE flag instead of SINGLEFRAME flag.
        (newPixels): Adapt to Vector consumers.
        (sendPicture): Set the color model of the image consumer.
        (newPixels(IIII)): Adapt to Vector consumers.
        (newPixels(IIIIB)): Adapt to Vector consumers.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: MemoryImageSource3.patch
Type: text/x-patch
Size: 4537 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20040713/c3fabdd9/attachment.bin>


More information about the Java-patches mailing list