Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix make THREAD_MODEL=posix #311

Merged
merged 24 commits into from
Aug 9, 2022
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
626362a
Fixes for the THREAD_MODEL=posix build
sbc100 Jul 18, 2022
384da08
Fix expected symbols from previous commit
abrown Jul 26, 2022
0e7956a
Enable `lock` in `random.c` when threads are enabled
abrown Jul 26, 2022
2ab390a
Disable `aio.h` when compiling for threads
abrown Jul 26, 2022
b2f40de
Specify the TLS model until LLVM 15 is released
abrown Jul 27, 2022
9d3b1e4
Rename `__wasi_libc_pthread_self` to `__wasilibc_pthread_self`
abrown Jul 28, 2022
04f6c3f
Add different sets of expected output based on THREAD_MODEL
abrown Jul 28, 2022
d2d3e5c
Re-add trailing whitespace to `predefined-macros.txt`
abrown Jul 28, 2022
83a80a7
Protect `preopens.c` against concurrent access
abrown Jul 28, 2022
247bfeb
Only build thread-capable wasi-libc on latest version of Clang
abrown Jul 28, 2022
0acb15f
Use `thrd_sleep` from MUSL instead of aliasing `nanosleep`
abrown Jul 28, 2022
240c35f
Define `pthread_setcancelstate` in `THREAD_MODEL=posix` builds
abrown Jul 28, 2022
e74d263
Define a Wasm global to store `pthread_self`
abrown Aug 1, 2022
0878de7
Remove `g_needs_dynamic_alloc` global
abrown Aug 1, 2022
db89382
Document the state of pthread support
abrown Aug 1, 2022
53a4091
review: de-duplicate symbols based on #314
abrown Aug 1, 2022
6539705
review: only define `__wasilibc_cwd_{un}lock` when needed
abrown Aug 1, 2022
3784170
review: add #ifdefs to `__pthread_setcancelstate`
abrown Aug 1, 2022
2339e18
review: add additional #ifdefs to `pthread_self.c`
abrown Aug 1, 2022
80d9a43
review: put lock definition behind #ifdef _REENTRANT
abrown Aug 8, 2022
d5bf750
review: remove pthread_setcancelstate.c
abrown Aug 8, 2022
eb50290
review: re-fix indentation
abrown Aug 8, 2022
1d6a27c
review: alias __clock_nanosleep in bottom half
abrown Aug 8, 2022
831de19
review: remove extra line
abrown Aug 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
review: add #ifdefs to __pthread_setcancelstate
abrown committed Aug 1, 2022
commit 3784170dfc858785c504a06c928b3e2e338ad181
14 changes: 7 additions & 7 deletions libc-top-half/musl/src/thread/pthread_setcancelstate.c
Original file line number Diff line number Diff line change
@@ -2,13 +2,13 @@

int __pthread_setcancelstate(int new, int *old)
{
#ifdef _REENTRANT
if (new > 2U) return EINVAL;
struct pthread *self = __pthread_self();
if (old) *old = self->canceldisable;
self->canceldisable = new;
#endif
return 0;
#if defined(__wasilibc_unmodified_upstream) || defined(_REENTRANT)
if (new > 2U) return EINVAL;
struct pthread *self = __pthread_self();
if (old) *old = self->canceldisable;
self->canceldisable = new;
#endif
return 0;
}

weak_alias(__pthread_setcancelstate, pthread_setcancelstate);