[PATCH] ntdll: Increase timeout in get_thread_context().

Paul Gofman pgofman at codeweavers.com
Mon Apr 12 13:39:02 CDT 2021


Fixes hangs during loading or after campaign start in
Mount & Blade II: Bannerlord.

Signed-off-by: Paul Gofman <pgofman at codeweavers.com>
---
    The hang happens when NtGetContextThread fails due to time out
    (after successful thread suspend). The timeout happens as the
    thread is busy in read() for regular file called from NtReadFile
    and does not process SIGUSR1 until read is complete. The read()
    may take a real long time when the disk is under heavy load.

 dlls/ntdll/unix/thread.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c
index 1a882a99855..a7e2fdef248 100644
--- a/dlls/ntdll/unix/thread.c
+++ b/dlls/ntdll/unix/thread.c
@@ -618,7 +618,7 @@ NTSTATUS get_thread_context( HANDLE handle, context_t *context, unsigned int fla
     if (ret == STATUS_PENDING)
     {
         LARGE_INTEGER timeout;
-        timeout.QuadPart = -1000000;
+        timeout.QuadPart = -5000000;
         if (NtWaitForSingleObject( handle, FALSE, &timeout ))
         {
             NtClose( handle );
-- 
2.30.2




More information about the wine-devel mailing list