test case demonstrating PeekMessage give up timeslices

Alexandre Julliard julliard at winehq.org
Wed Aug 3 03:36:08 CDT 2005


Jeremy White <jwhite at codeweavers.com> writes:

> However, this makes it clear to me that the yield
> in message.c is largely moot; you need to remove both
> that one and the one in ntdll/sync.c to have
> any material effect on Wine timing with messages.

Actually it should be enough to not yield in MsgWaitForMultipleObjects
when we are only checking for X events, and that would be correct IMO
since the check for X events is always in addition to the normal
behavior. Something like this should do it:

Index: dlls/x11drv/event.c
===================================================================
RCS file: /opt/cvs-commit/wine/dlls/x11drv/event.c,v
retrieving revision 1.56
diff -u -p -r1.56 event.c
--- dlls/x11drv/event.c	25 Jul 2005 11:08:43 -0000	1.56
+++ dlls/x11drv/event.c	3 Aug 2005 08:28:52 -0000
@@ -295,12 +295,13 @@ DWORD X11DRV_MsgWaitForMultipleObjectsEx
 
     data->process_event_count++;
     if (process_events( data->display, mask )) ret = count;
-    else
+    else if (count || timeout)
     {
         ret = WaitForMultipleObjectsEx( count+1, new_handles, flags & MWMO_WAITALL,
                                         timeout, flags & MWMO_ALERTABLE );
         if (ret == count) process_events( data->display, mask );
     }
+    else ret = WAIT_TIMEOUT;
     data->process_event_count--;
     return ret;
 }


-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list