b30aff405a
The problem with the original patch was that using syscall(3) means that
errno can be set, but pthread_create(3) was abusing the TLS errno slot as
a pthread_mutex_t for the thread startup handshake.
There was also a mistake in the check for syscall failures --- it should
have checked against -1 instead of 0 (not just because that's the default
idiom, but also here because futex(2) can legitimately return values > 0).
This patch stops abusing the TLS errno slot and adds a pthread_mutex_t to
pthread_internal_t instead. (Note that for LP64 sizeof(pthread_mutex_t) >
sizeof(uintptr_t), so we could potentially clobber other TLS slots too.)
I've also rewritten the LP32 compatibility stubs to directly reuse the
code from the .h file.
This reverts commit
|
||
---|---|---|
.. | ||
__get_tls.h | ||
bionic_asm.h | ||
bionic_atomic_arm.h | ||
bionic_atomic_arm64.h | ||
bionic_atomic_gcc_builtin.h | ||
bionic_atomic_inline.h | ||
bionic_atomic_mips.h | ||
bionic_atomic_x86.h | ||
bionic_auxv.h | ||
bionic_futex.h | ||
bionic_macros.h | ||
bionic_name_mem.h | ||
bionic_pthread.h | ||
bionic_ssp.h | ||
bionic_time.h | ||
bionic_time_conversions.h | ||
bionic_tls.h | ||
ErrnoRestorer.h | ||
kernel_sigset_t.h | ||
KernelArgumentBlock.h | ||
libc_events.h | ||
libc_logging.h | ||
NetdClientDispatch.h | ||
ScopedPthreadMutexLocker.h | ||
ScopedReaddir.h | ||
thread_private.h | ||
ThreadLocalBuffer.h |