feat(wasi-threads): Add example of exception propagation (#1812)

This commit is contained in:
Enrico Loparco
2022-12-16 06:22:53 +00:00
committed by GitHub
parent 929d5942b9
commit 8fc641377a
3 changed files with 118 additions and 1 deletions

View File

@ -1 +1,24 @@
# "WASI threads" sample introduction
# "WASI threads" sample introduction
Currently, since the `wasi-sdk` does not have thread support in the latest release, make sure to have [wasi-libc](https://github.com/WebAssembly/wasi-libc) installed. Build it with threads enabled, e.g.
```shell
make \
AR=/opt/wasi-sdk/bin/llvm-ar \
NM=/opt/wasi-sdk/bin/llvm-nm \
CC=/opt/wasi-sdk/bin/clang \
THREAD_MODEL=posix
```
Build and run the samples
```shell
$ mkdir build
$ cd build
$ cmake -DWASI_SYSROOT=/path/to/wasi-libc/sysroot ..
$ make
...
$ ./iwasm wasm-apps/no_pthread.wasm
...
$ ./iwasm wasm-apps/exception_propagation.wasm
```