cosmopolitan/libc/thread
Trung Nguyen 8b33204f37
Add LLVM libcxxabi (#1063)
* third_party: Add libcxxabi

Added libcxxabi from LLVM 17.0.6
The library implements the Itanium C++ exception handling ABI.

* third_party/libcxxabi: Enable __cxa_thread_atexit

Enable `__cxa_thread_atexit` from libcxxabi.
`__cxa_thread_atexit_impl` is still implemented by the cosmo libc.
The original `__cxa_thread_atexit` has been removed.

* third_party/libcxx: Build with exceptions

Build libcxx with exceptions enabled.

- Removed `_LIBCPP_NO_EXCEPTIONS` from `__config`.
- Switched the exception implementation to `libcxxabi`. These two files
are taken from the same `libcxx` version as mentioned in `README.cosmo`.
- Removed `new_handler_fallback` in favor of `libcxxabi` implementation.
- Enable `-fexceptions` and `-frtti` for `libcxx`.
- Removed `THIRD_PARTY_LIBCXX` dependency from `libcxxabi` and
`libunwind`. These libraries do not use any runtime `libcxx` functions,
just headers.

* libc: Remove remaining redundant cxa functions

- `__cxa_pure_virtual` in `libcxxabi` is also a stub similar to the
existing one.
- `__cxa_guard_*` from `libcxxabi` is used instead of the ones from
Android.

Now there should be no more duplicate implementations.
`__cxa_thread_atexit_impl`, `__cxa_atexit`, and related supporting
functions, are still left to other libraries as in `libcxxabi`.

`libcxxabi` is also now added to `cosmopolitan.a` to make up for the
removed functions.

Affected in-tree libraries (`third_party/double-conversion`) have been
updated.
2024-01-08 08:45:10 -08:00
..
__cxa_thread_atexit_impl.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
alarm.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
BUILD.mk more modeline errata (#1019) 2023-12-16 23:07:10 -05:00
freebsd.internal.h Reduce header complexity 2023-11-28 14:39:42 -08:00
getitimer.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
itimer.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
itimer.internal.h Reduce header complexity 2023-11-28 14:39:42 -08:00
makecontext.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
mktls.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
openbsd.internal.h Reduce header complexity 2023-11-28 14:39:42 -08:00
posixthread.internal.h Reduce header complexity 2023-11-28 14:39:42 -08:00
pt.internal.h Reduce header complexity 2023-11-28 14:39:42 -08:00
pthread_atfork.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_attr_destroy.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_attr_getdetachstate.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_attr_getguardsize.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_attr_getinheritsched.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_attr_getschedparam.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_attr_getschedpolicy.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_attr_getscope.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_attr_getsigmask_np.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_attr_getstack.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_attr_getstacksize.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_attr_init.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_attr_setdetachstate.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_attr_setguardsize.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_attr_setinheritsched.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_attr_setschedparam.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_attr_setschedpolicy.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_attr_setscope.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_attr_setsigmask_np.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_attr_setstack.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_attr_setstacksize.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_barrier_destroy.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_barrier_init.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_barrier_wait.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_barrierattr_destroy.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_barrierattr_getpshared.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_barrierattr_init.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_barrierattr_setpshared.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_cancel.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_cond_broadcast.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_cond_destroy.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_cond_init.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_cond_signal.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_cond_timedwait.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_cond_wait.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_condattr_destroy.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_condattr_getpshared.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_condattr_init.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_condattr_setpshared.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_create.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_detach.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_equal.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_exit.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_getaffinity_np.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_getattr_np.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_getname_np.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_getschedparam.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_getspecific.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_getthreadid_np.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_getunique_np.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_join.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_key_create.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_key_delete.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_keys.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_kill.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_once.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_orphan_np.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_reschedule.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_rwlock_destroy.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_rwlock_init.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_rwlock_rdlock.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_rwlock_tryrdlock.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_rwlock_trywrlock.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_rwlock_unlock.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_rwlock_wrlock.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_rwlockattr_destroy.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_rwlockattr_getpshared.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_rwlockattr_init.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_rwlockattr_setpshared.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_self.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_setaffinity_np.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_setcanceltype.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_setname_np.c Introduce FreeBSD ARM64 support 2023-12-29 20:14:02 -08:00
pthread_setschedparam.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_setschedparam_freebsd.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_setschedprio.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_sigmask.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_timedjoin_np.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_tryjoin_np.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_ungarbage.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_zombify.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
README.md Use *NSYNC for POSIX threads locking APIs 2022-09-11 11:04:50 -07:00
sem_destroy.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
sem_getvalue.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
sem_init.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
sem_open.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
sem_post.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
sem_timedwait.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
sem_trywait.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
sem_wait.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
semaphore.h Reduce header complexity 2023-11-28 14:39:42 -08:00
setitimer.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
thread.h Cleanup inline locking code 2023-11-29 00:36:22 -08:00
thread2.h Reduce header complexity 2023-11-28 14:39:42 -08:00
tls.h Make cosmo_dlopen() safer and faster 2024-01-05 20:42:19 -08:00
tls2.internal.h Make cosmo_dlopen() safer and faster 2024-01-05 20:42:19 -08:00
ualarm.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
xnu.internal.h Reduce header complexity 2023-11-28 14:39:42 -08:00

Cosmpolitan POSIX Threads Library

Cosmopolitan Libc implements threading as it is written in The Open Group Base Specifications Issue 7, 2018 edition IEEE Std 1003.1-2017 (Revision of IEEE Std 1003.1-2008) in addition to GNU extensions.