This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Patch: Window and Dialog fixes
>>>>> "Tom" == Thomas Fitzsimmons <fitzsim@redhat.com> writes:
More comments...
Tom> + parent = owner;
Tom> + owner.ownedWindows.add(new WeakReference(this));
Synchronization is needed here, when changing owner.ownedWindows, as
the other users of ownedWindows also synchronize.
Should we synchronize on the tree lock instead of on the Window?
Tom> + public synchronized Window[] getOwnedWindows()
This method needs to be implemented a different way. The problem is
that a WeakReference can be cleared between the two loops.
Maybe the only way to do this is to allocate a possibly-too-large
array, fill it, and then create a new, smaller array if need be.
Tom