Commit d25afce
committed
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.THREAD_MODEL=single.1 parent 36e12fd commit d25afce
3 files changed
Lines changed: 14 additions & 3 deletions
| 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 | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
229 | | - | |
| 229 | + | |
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| |||
- 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-top-half/musl/include/pthread.h+7-18
- libc-top-half/musl/include/unistd.h+2-2
- 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
- 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