bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug awt/21600] race condition with java applet


From: fitzsim at redhat dot com
Subject: [Bug awt/21600] race condition with java applet
Date: 18 Aug 2005 02:03:08 -0000

------- Additional Comments From fitzsim at redhat dot com  2005-08-18 02:03 
-------
This was a problem with locking in the GTK peers and interactions between the
main and event threads.

We connect a callback to the window realize signal.  In that callback we release
the GDK lock.  The 1x1 window appears when the main thread calls
GtkWindowPeer.nativeSetVisible.  That method obtains the GDK lock, then calls
gtk_widget_show.  That eventually calls the realize callback, which then
releases the GDK lock.  Now, with the window initialization sequence left
unlocked, the event dispatch thread can and does take control and receives a 1x1
configure event, before the window initialization is complete.  I'm not sure why
X/Metacity sends the bogus 1x1 configure event, but it only sends this within
this unlocked period.  If the lock is held during the callback we receive a
configure event with proper dimensions after window initialization is complete.

I fixed this by reworking the peers so that we never release the GDK lock within
callbacks.  It turns out this is never safe to do anyway, so it probably
eliminates other similar race conditions.

Closing.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21600




reply via email to

[Prev in Thread] Current Thread [Next in Thread]