Alexandre Julliard : ntdll: Added a sleep in NtGet/SetContextThread, a yield is not enough on some kernels.

Alexandre Julliard julliard at winehq.org
Mon Dec 3 09:17:51 CST 2007


Module: wine
Branch: master
Commit: 3ae370dc71481dd7e50d439dd82b29ded2908c04
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=3ae370dc71481dd7e50d439dd82b29ded2908c04

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Dec  3 13:55:25 2007 +0100

ntdll: Added a sleep in NtGet/SetContextThread, a yield is not enough on some kernels.

---

 dlls/ntdll/thread.c |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
index 37a845f..15768c2 100644
--- a/dlls/ntdll/thread.c
+++ b/dlls/ntdll/thread.c
@@ -820,8 +820,13 @@ NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context )
                         ret = wine_server_call( req );
                     }
                     SERVER_END_REQ;
-                    if (ret != STATUS_PENDING) break;
-                    NtYieldExecution();
+                    if (ret == STATUS_PENDING)
+                    {
+                        LARGE_INTEGER timeout;
+                        timeout.QuadPart = -10000;
+                        NtDelayExecution( FALSE, &timeout );
+                    }
+                    else break;
                 }
                 NtResumeThread( handle, &dummy );
             }
@@ -1110,8 +1115,13 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
                         ret = wine_server_call( req );
                     }
                     SERVER_END_REQ;
-                    if (ret != STATUS_PENDING) break;
-                    NtYieldExecution();
+                    if (ret == STATUS_PENDING)
+                    {
+                        LARGE_INTEGER timeout;
+                        timeout.QuadPart = -10000;
+                        NtDelayExecution( FALSE, &timeout );
+                    }
+                    else break;
                 }
                 NtResumeThread( handle, &dummy );
             }




More information about the wine-cvs mailing list