[PATCH] gdiplus: Created ADD_GTCTO environment variable that increases thread suspension time out.

Vanida Plamondon vanida.plamondon at gmail.com
Thu May 23 17:49:58 CDT 2019


This patch was made as using an environment variable instead of a
registry entry because it addresses unwanted/bugged behaviour. I
could be wrong about that.

With ADD_GTCTO=5000, Magic the Gathering: Arena's updater/
downloader completes without issue. It should work for other
outdated unity-build games that suffer the same issue.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45546
Signed-off-by: Vanida Plamondon <vanida.plamondon at gmail.com>
---
v1: Created ADD_GTCTO environment variable
---
 dlls/ntdll/thread.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
index 46de839400..09aa94ba65 100644
--- a/dlls/ntdll/thread.c
+++ b/dlls/ntdll/thread.c
@@ -23,6 +23,7 @@
 
 #include <assert.h>
 #include <stdarg.h>
+#include <stdlib.h>
 #include <limits.h>
 #include <sys/types.h>
 #ifdef HAVE_SYS_MMAN_H
@@ -772,7 +773,11 @@ NTSTATUS set_thread_context( HANDLE handle, const context_t *context, BOOL *self
 NTSTATUS get_thread_context( HANDLE handle, context_t *context, unsigned int flags, BOOL *self )
 {
     NTSTATUS ret;
-    DWORD dummy, i;
+    DWORD dummy, i, gtcto;
+
+    /* get the ADD_GTCTO value, if any */
+    const char *add_gtcto = getenv( "ADD_GTCTO" );
+    gtcto = add_gtcto ? ( DWORD ) ( atol( add_gtcto) + 100 ) : 100;
 
     SERVER_START_REQ( get_thread_context )
     {
@@ -787,7 +792,7 @@ NTSTATUS get_thread_context( HANDLE handle, context_t *context, unsigned int fla
 
     if (ret == STATUS_PENDING)
     {
-        for (i = 0; i < 100; i++)
+        for (i = 0; i < gtcto; i++)
         {
             SERVER_START_REQ( get_thread_context )
             {
-- 
2.20.1




More information about the wine-devel mailing list