From: Holger Schemel Date: Thu, 23 Sep 2021 07:48:59 +0000 (+0200) Subject: fixed threads for Emscripten X-Git-Tag: 4.3.0.0~44 X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=commitdiff_plain;h=44237219241bda65f4ca1476a877cd04dca54b27 fixed threads for Emscripten --- 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)