mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-01 16:58:30 +00:00
Upgrade to 2022-era LLVM LIBCXX
This commit is contained in:
parent
2f4ca71f26
commit
8e68384e15
2078 changed files with 165657 additions and 65010 deletions
|
@ -75,14 +75,13 @@ void _pthread_free(struct PosixThread *pt, bool isfork) {
|
|||
unassert(!munmap(pt->pt_attr.__stackaddr, pt->pt_attr.__stacksize));
|
||||
}
|
||||
if (!isfork) {
|
||||
if (IsWindows()) {
|
||||
if (pt->tib->tib_syshand) {
|
||||
unassert(CloseHandle(pt->tib->tib_syshand));
|
||||
}
|
||||
} else if (IsXnuSilicon()) {
|
||||
if (pt->tib->tib_syshand) {
|
||||
__syslib->__pthread_join(pt->tib->tib_syshand, 0);
|
||||
}
|
||||
uint64_t syshand =
|
||||
atomic_load_explicit(&pt->tib->tib_syshand, memory_order_acquire);
|
||||
if (syshand) {
|
||||
if (IsWindows())
|
||||
unassert(CloseHandle(syshand));
|
||||
else if (IsXnuSilicon())
|
||||
__syslib->__pthread_join(syshand, 0);
|
||||
}
|
||||
}
|
||||
free(pt->pt_tls);
|
||||
|
|
|
@ -164,7 +164,8 @@ wontreturn void pthread_exit(void *rc) {
|
|||
// note that the main thread is joinable by child threads
|
||||
if (pt->pt_flags & PT_STATIC) {
|
||||
atomic_store_explicit(&tib->tib_tid, 0, memory_order_release);
|
||||
nsync_futex_wake_(&tib->tib_tid, INT_MAX, !IsWindows() && !IsXnu());
|
||||
nsync_futex_wake_((atomic_int *)&tib->tib_tid, INT_MAX,
|
||||
!IsWindows() && !IsXnu());
|
||||
_Exit1(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -44,8 +44,7 @@ COSMOPOLITAN_C_START_
|
|||
#define PTHREAD_COND_INITIALIZER _PTHREAD_INIT
|
||||
#define PTHREAD_RWLOCK_INITIALIZER _PTHREAD_INIT
|
||||
#define PTHREAD_MUTEX_INITIALIZER _PTHREAD_INIT
|
||||
#define _PTHREAD_INIT \
|
||||
{ 0 }
|
||||
#define _PTHREAD_INIT {0}
|
||||
|
||||
typedef uintptr_t pthread_t;
|
||||
typedef int pthread_id_np_t;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue