about summary refs log tree commit diff stats
path: root/src/wrapped/wrappedsdl2.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/wrapped/wrappedsdl2.c')
-rw-r--r--src/wrapped/wrappedsdl2.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/wrapped/wrappedsdl2.c b/src/wrapped/wrappedsdl2.c
index d12cea24..299237f2 100644
--- a/src/wrapped/wrappedsdl2.c
+++ b/src/wrapped/wrappedsdl2.c
@@ -820,6 +820,17 @@ EXPORT void my2_SDL_GetJoystickGUIDInfo(SDL_JoystickGUID guid, uint16_t *vend, u
     }
 }
 
+EXPORT unsigned long my2_SDL_GetThreadID(x64emu_t* emu, void* thread)
+{
+    unsigned long ret = my->SDL_GetThreadID(thread);
+    int max = 10;
+    while (!ret && max--) {
+        sched_yield();
+        ret = my->SDL_GetThreadID(thread);
+    }
+    return ret;
+}
+
 #undef HAS_MY
 
 #define ALTMY my2_