Commit dadbd94
authored
Enable pthreads in libc++ for
This commit enables thread support in libc++ for all thread models,
enabling C++ applications that use threading APIs like `<atomic>` but do
not spawn threads (e.g. Clang) to be built with minimal changes.
Fixes #546.
Depends on WebAssembly/wasi-libc#602.THREAD_MODEL=single (#548)1 parent 36e12fd commit dadbd94
3 files changed
+17
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
| 217 | + | |
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
221 | 232 | | |
222 | 233 | | |
223 | 234 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
226 | 225 | | |
227 | 226 | | |
228 | 227 | | |
229 | | - | |
230 | 228 | | |
231 | 229 | | |
232 | 230 | | |
| |||
262 | 260 | | |
263 | 261 | | |
264 | 262 | | |
265 | | - | |
266 | | - | |
| 263 | + | |
| 264 | + | |
267 | 265 | | |
268 | 266 | | |
269 | 267 | | |
| |||
280 | 278 | | |
281 | 279 | | |
282 | 280 | | |
283 | | - | |
284 | | - | |
| 281 | + | |
| 282 | + | |
285 | 283 | | |
286 | 284 | | |
287 | 285 | | |
| |||
- Makefile+33-27
- expected/wasm32-wasip1/defined-symbols.txt+4-3
- expected/wasm32-wasip1/predefined-macros.txt+4-5
- expected/wasm32-wasip2/defined-symbols.txt+4-3
- expected/wasm32-wasip2/predefined-macros.txt+4-5
- libc-bottom-half/sources/preopens.c+1-1
- libc-top-half/musl/include/pthread.h+7-18
- libc-top-half/musl/include/unistd.h+2-2
- libc-top-half/musl/src/string/memchr.c+62
- libc-top-half/musl/src/string/strchrnul.c+47
- libc-top-half/musl/src/string/strlen.c+15-15
- stub-pthreads/README.md-16
- stub-pthreads/barrier.c-23
- stub-pthreads/condvar.c-36
- stub-pthreads/mutex.c-67
- stub-pthreads/rwlock.c-60
- stub-pthreads/spinlock.c-21
- stub-pthreads/stub-pthreads-emulated.c-40
- stub-pthreads/stub-pthreads-good.c-43
- test/src/misc/memchr.c+53
- test/src/misc/strchrnul.c+58
- thread-stub/README.md+7
- thread-stub/pthread_barrier_destroy.c+6
- thread-stub/pthread_barrier_init.c+8
- thread-stub/pthread_barrier_wait.c+7
- thread-stub/pthread_cond_broadcast.c+6
- thread-stub/pthread_cond_destroy.c+6
- thread-stub/pthread_cond_init.c+6
- thread-stub/pthread_cond_signal.c+6
- thread-stub/pthread_cond_timedwait.c+13
- thread-stub/pthread_cond_wait.c+9
- thread-stub/pthread_create.c+19
- thread-stub/pthread_detach.c+13
- thread-stub/pthread_getattr_np.c+11
- thread-stub/pthread_join.c+32
- thread-stub/pthread_mutex_consistent.c+8
- thread-stub/pthread_mutex_getprioceiling.c+6
- thread-stub/pthread_mutex_lock.c+21
- thread-stub/pthread_mutex_timedlock.c+10
- thread-stub/pthread_mutex_trylock.c+21
- thread-stub/pthread_mutex_unlock.c+10
- thread-stub/pthread_once.c+12
- thread-stub/pthread_rwlock_rdlock.c+11
- thread-stub/pthread_rwlock_timedrdlock.c+8
- thread-stub/pthread_rwlock_timedwrlock.c+8
- thread-stub/pthread_rwlock_tryrdlock.c+11
- thread-stub/pthread_rwlock_trywrlock.c+10
- thread-stub/pthread_rwlock_unlock.c+12
- thread-stub/pthread_rwlock_wrlock.c+10
- thread-stub/pthread_spin_lock.c+8
- thread-stub/pthread_spin_trylock.c+8
- thread-stub/pthread_spin_unlock.c+7
0 commit comments