Merge pull request #32 from jedisct1/wasm

Port to WebAssembly
This commit is contained in:
Daan 2019-07-15 11:03:46 -07:00 committed by GitHub
commit ad45dbf0e5
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 51 additions and 1 deletions

View file

@ -196,6 +196,11 @@ static inline void mi_atomic_write(volatile uintptr_t* p, uintptr_t x) {
asm volatile("yield");
}
#endif
#elif defined(__wasi__)
#include <sched.h>
static inline void mi_atomic_yield() {
sched_yield();
}
#else
#include <unistd.h>
static inline void mi_atomic_yield(void) {