avoid potential deadlock

Ulrich Czekalla ulrich.czekalla at utoronto.ca
Tue Aug 10 15:47:02 CDT 2004


ChangeLog:
        Ulrich Czekalla <ulrich at codeweavers.com>
        Avoid holding x11drv lock while calling function that grabs gdi
        lock. Prevents potential deadly embrace.
-------------- next part --------------
Index: dlls/x11drv/winpos.c
===================================================================
RCS file: /home/wine/wine/dlls/x11drv/winpos.c,v
retrieving revision 1.93
diff -u -r1.93 winpos.c
--- dlls/x11drv/winpos.c	6 Jul 2004 23:57:01 -0000	1.93
+++ dlls/x11drv/winpos.c	10 Aug 2004 20:44:16 -0000
@@ -959,7 +959,6 @@
             wine_tsx11_unlock();
         }
 
-        wine_tsx11_lock();
         if (bChangePos)
             X11DRV_sync_whole_window_position( display, wndPtr, !(winpos->flags & SWP_NOZORDER) );
         else
@@ -973,7 +972,9 @@
             (winpos->flags & SWP_FRAMECHANGED))
         {
             /* if we moved the client area, repaint the whole non-client window */
+            wine_tsx11_lock();
             XClearArea( display, get_whole_window(wndPtr), 0, 0, 0, 0, True );
+            wine_tsx11_unlock();
             winpos->flags |= SWP_FRAMECHANGED;
         }
         if (winpos->flags & SWP_SHOWWINDOW)
@@ -986,8 +987,11 @@
         {
             /* resizing from zero size to non-zero -> map */
             TRACE( "mapping non zero size or off-screen win %p\n", winpos->hwnd );
+            wine_tsx11_lock();
             XMapWindow( display, get_whole_window(wndPtr) );
+            wine_tsx11_unlock();
         }
+        wine_tsx11_lock();
         XFlush( display );  /* FIXME: should not be necessary */
         wine_tsx11_unlock();
     }


More information about the wine-patches mailing list