From 44237219241bda65f4ca1476a877cd04dca54b27 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Thu, 23 Sep 2021 09:48:59 +0200 Subject: [PATCH] fixed threads for Emscripten --- src/files.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/files.c b/src/files.c index 06c1ac51..a2b1beda 100644 --- a/src/files.c +++ b/src/files.c @@ -9032,6 +9032,10 @@ void SaveScore(int nr) void ExecuteAsThread(SDL_ThreadFunction function, char *name, void *data, char *error) { +#if defined(PLATFORM_EMSCRIPTEN) + // threads currently not fully supported by Emscripten/SDL and some browsers + function(data); +#else SDL_Thread *thread = SDL_CreateThread(function, name, data); if (thread != NULL) @@ -9041,6 +9045,7 @@ void ExecuteAsThread(SDL_ThreadFunction function, char *name, void *data, // nasty kludge to lower probability of intermingled thread error messages Delay(1); +#endif } char *getPasswordJSON(char *password) -- 2.34.1