diff options
author | Cheng Shao <astrohavoc@gmail.com> | 2022-10-23 17:00:19 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-11-11 00:26:55 -0500 |
commit | f271e7cab7e6a46d4c958bfb9f4daeee549451b7 (patch) | |
tree | 3f01d1b47b1ab548e10c4c9d61dfa37a10ad94a6 | |
parent | 654a3d46e4ec5919e3c2d0c90db252f6a670e44a (diff) | |
download | haskell-f271e7cab7e6a46d4c958bfb9f4daeee549451b7.tar.gz |
rts: OSThreads.h: stub types for wasm32
This patch defines stub Condition/Mutex/OSThreadId/ThreadLocalKey
types for wasm32, just enough to unblock compiling RTS. Any
threading-related functionality has been patched to be disabled on
wasm32.
-rw-r--r-- | rts/include/rts/OSThreads.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/rts/include/rts/OSThreads.h b/rts/include/rts/OSThreads.h index e0b34c3160..8ffb25fabf 100644 --- a/rts/include/rts/OSThreads.h +++ b/rts/include/rts/OSThreads.h @@ -158,6 +158,22 @@ typedef SRWLOCK Mutex; #endif // CMINUSMINUS +# elif defined(wasm32_HOST_ARCH) + +#if defined(CMINUSMINUS) +#else // CMINUSMINUS + +#include <errno.h> + +typedef void* Condition; +typedef void* Mutex; +typedef void* OSThreadId; +typedef void* ThreadLocalKey; + +#define OSThreadProcAttr + +#endif // CMINUSMINUS + # elif defined(THREADED_RTS) # error "Threads not supported" # endif |