History log of /bionic/libc/bionic/pthread.c
Revision Date Author Comments
88f1ea8f82e1fcef0d472577f00cd889b796e944 18-Sep-2012 Dave Burke <daveburke@google.com> Make pthread_create more forgiving of invalid sched_policy.
Bug: 7005326

(cherry-pick of e58303249b9e799a4fe84c5a2dfe71518441a6ec.)

Change-Id: Ie81494e0f6a71caa6fd9fabbcfc47a23077554d6
e58303249b9e799a4fe84c5a2dfe71518441a6ec 18-Sep-2012 Dave Burke <daveburke@google.com> Make pthread_create more forgiving of invalid sched_policy.
Bug: 7005326

Change-Id: I4e33d8e7d70fbfcf8a1bcc0e4c33279b42092a0a
bfeab1bbe7e8d0c08b7e3f46aedab64e3b2bf706 06-Sep-2012 Elliott Hughes <enh@google.com> Don't corrupt the thread list in static executables.

Several previous changes conspired to make a mess of the thread list
in static binaries. This was most obvious when trying to call
pthread_key_delete(3) on the main thread.

Bug: http://code.google.com/p/android/issues/detail?id=36893
Change-Id: I2a2f553114d8fb40533c481252b410c10656da2e
2932f048327965731c7e1ab9f2968a2ddb1854f5 05-Jul-2012 Jurijs Oniscuks <jurijs.oniscuks@sonymobile.com> Fix race condition in pthread_create()

Save thread id to *thread_out before new
thread is allowed to run else there's a
risk that the thread has finished and
been deleted when *thread_out is assigned.

Change-Id: I6b84c61a8df06840877d4ab036f26feace3192d8
0753dc653eb3b84d3490212437e7490975d4c020 04-May-2012 Bjorn Andersson <bjorn.andersson@sonymobile.com> pthread: Invalidate stale stack pointers on pthread_exit()

A call to pthread_key_delete() after pthread_exit() have unmapped the stack of a thread
but before the ongoing pthread_join() have finished executing will result in an access
to unmapped memory.
Avoid this by invalidating the stack_base and tls pointers during pthread_exit().

This is based on the investigation and proprosed solution by
Srinavasa Nagaraju <srinavasa.x.nagaraju@sonyericsson.com>

Change-Id: I145fb5d57930e91b00f1609d7b2cd16a55d5b3a9
d0c884d3595ecca03c3e70de9909c090cd5f9cae 22-Feb-2012 Pierre Peiffer <pierre.peiffer@stericsson.com> Let pthread_create fail if schedparam can't be set

The creation of a thread succeeds even if the requested scheduling
parameters can not be set. This is not POSIX compliant, and even
worse, it leads to a wrong behavior. Let pthread_create() fail in this
case.

Change-Id: Ice66e2a720975c6bde9fe86c2cf8f649533a169c
Signed-off-by: Christian Bejram <christian.bejram@stericsson.com>
1a78fbb5c8228e4aea2a516818828b76044310f2 22-Mar-2012 Evgeniy Stepanov <eugenis@google.com> Initialize TLS before any application code is run.

Since e19d702b8e33, dlsym and friends use recursive mutexes that
require the current thread id, which is not available before the libc
constructor. This prevents us from using dlsym() in .preinit_array.

This change moves TLS initialization from libc constructor to the earliest
possible point - immediately after linker itself is relocated. As a result,
pthread_internal_t for the initial thread is available from the start.

As a bonus, values stored in TLS in .preinit_array are not lost when libc is
initialized.

Change-Id: Iee5a710ee000173bff63e924adeb4a4c600c1e2d
faca92f2f17cea192c5fbde4d869aa7620315196 27-Mar-2012 Jean-Baptiste Queru <jbq@google.com> Handle pthread-related changes (mutex/atfork)

First commit:

Revert "Revert "am be741d47: am 2f460fbe: am 73b5cad9: Merge "bionic: Fix wrong kernel_id in pthread descriptor after fork()"""

This reverts commit 06823da2f0c8b4a4ce4c45113032f03df85c94b8.

Second commit:

bionic: fix atfork hanlder_mutex deadlock

This cherry-picks commit 34e89c232dd5645fe3b5f9b40856d8e3e4cae57a

After applying the kernel_id fix, the system refused to boot up and we
got following crash log:
I/DEBUG ( 113): pid: 618, tid: 618 >>> org.simalliance.openmobileapi.service:remote <<<
I/DEBUG ( 113): signal 16 (SIGSTKFLT), code -6 (?), fault addr --------
I/DEBUG ( 113): eax fffffe00 ebx b77de994 ecx 00000080 edx 00724002
I/DEBUG ( 113): esi 00000000 edi 00004000
I/DEBUG ( 113): xcs 00000073 xds 0000007b xes 0000007b xfs 00000000 xss 0000007b
I/DEBUG ( 113): eip b7761351 ebp bfdf3de8 esp bfdf3dc4 flags 00000202
I/DEBUG ( 113): #00 eip: 00015351 /system/lib/libc.so
I/DEBUG ( 113): #01 eip: 0000d13c /system/lib/libc.so (pthread_mutex_lock)
I/DEBUG ( 113): #02 eip: 00077b48 /system/lib/libc.so (__bionic_atfork_run_prepare)
I/DEBUG ( 113): #03 eip: 00052cdb /system/lib/libc.so (fork)
I/DEBUG ( 113): #04 eip: 0009ae91 /system/lib/libdvm.so (_Z18dvmOptimizeDexFileillPKcjjb)
I/DEBUG ( 113): #05 eip: 000819d6 /system/lib/libdvm.so (_Z14dvmJarFileOpenPKcS0_PP7JarFileb)
I/DEBUG ( 113): #06 eip: 000b175e /system/lib/libdvm.so (_ZL40Dalvik_dalvik_system_DexFile_openDexFilePKjP6JValue)
I/DEBUG ( 113): #07 eip: 0011fb94 /system/lib/libdvm.so

Root cause:
The atfork uses the mutex handler_mutex to protect the atfork_head. The
parent will call __bionic_atfork_run_prepare() to lock the handler_mutex,
and need both the parent and child to unlock their own copy of handler_mutex
after fork. At that time, the owner of hanlder_mutex is set as the parent.
If we apply the kernel_id fix, then the child's kernel_id will be set as
child's tid.
The handler_mutex is a recursive lock, and pthread_mutex_unlock(&hander_mutex)
will fail because the mutex owner is the parent, while the current tid
(__get_thread()->kernel_id) is child, not matched with the mutex owner.
At that time, the handler_mutex is left in lock state.If the child wants to
fork other process after than, then it will try to lock handler_mutex, and
then be deadlocked.

Fix:
Since the child has its own copy of vm space from the the parent, the
child space's handler_mutex should be reset to the initialized state.

Change-Id: I3907dd9a153418fb78862f2aa6d0302c375d9e27
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Chenyang Du <chenyang.du@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>

Change-Id: Ic8072f366a877443a60fe215f3c00b3df5a259c8
06823da2f0c8b4a4ce4c45113032f03df85c94b8 13-Mar-2012 Guang Zhu <guangzhu@google.com> Revert "am be741d47: am 2f460fbe: am 73b5cad9: Merge "bionic: Fix wrong kernel_id in pthread descriptor after fork()""

This reverts commit 76d56cf4a94e875a8b621025e2780775247adb6e, reversing
changes made to c59ba4595be25a1213955233fcf9bcd1afe6438e.

Bug: 6157577
d8bc6e7119450f263afcf89c8b581f6aaa23d186 17-Jan-2012 Jack Ren <jack.ren@intel.com> bionic: Fix wrong kernel_id in pthread descriptor after fork()

After forking, the kernel_id field in the phtread_internal_t returned by pthread_self()
is incorrect --- it's the tid from the parent, not the new tid of the
child.

The root cause is that: currently the kernel_id is set by
_init_thread(), which is called in 2 cases:
(1) called by __libc_init_common(). That happens when the execv( ) is
called after fork( ). But when the zygote tries to fork the android
application, the child application doesn't call execv( ), instread, it
tries to call the Java main method directly.
(2) called by pthread_create(). That happens when a new thread is
created.

For the lead thread which is the thread created by fork(), it should
call execv() but it doesn't, as described in (1) above. So its kernel_id
will inherit the parent's kernel_id.

Fixed it in this patch.

Change-Id: I63513e82af40ec5fe51fbb69456b1843e4bc0fc7
Signed-off-by: Chenyang Du <chenyang.du@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
e1414aa96bb62057b1a25c6a9ea1797dd38dce59 24-Jan-2012 David 'Digit' Turner <digit@google.com> libc: remove global lock from recursive mutex implementation.

This optimization improves the performance of recursive locks
drastically. When running the thread_stress program on a Xoom,
the total time to perform all operations goes from 1500 ms to
500 ms on average after this change is pushed to the device.

Change-Id: I5d9407a9191bdefdaccff7e7edefc096ebba9a9d
b57db7581cabb98651c4d8940d65c5c404b914ad 24-Jan-2012 David 'Digit' Turner <digit@google.com> libc: Fix recursive mutex lock implementation.

This fixes a bug that was introduced in the latest pthread optimization.
It happens when a recursive lock is contented by several threads. The main
issue was that the atomic counter increment in _recursive_increment() could
be annihilated by a non-conditional write in pthread_mutex_lock() used to
update the value's lower bits to indicate contention.

This patch re-introduces the use of the global recursive lock in
_recursive_increment(). This will hit performance, but a future patch
will be provided to remove it from the source code.

Change-Id: Ie22069d376cebf2e7d613ba00b6871567f333544
7c0c3793722aea293c45921ef50e4adcdf9645ce 06-Sep-2011 Mathias Agopian <mathias.agopian@gmail.com> implement pthread mutex deadlock detection

this works by building a directed graph of acquired
pthread mutexes and making sure there are no loops in
that graph.

this feature is enabled with:

setprop debug.libc.pthread 1

when a potential deadlock is detected, a large warning is
output to the log with appropriate back traces.

currently disabled at compile-time. set PTHREAD_DEBUG_ENABLED=1
to enable.

Change-Id: I916eed2319599e8aaf8f229d3f18a8ddbec3aa8a
022d303116f742cd337852d37547e2ea24d97a25 07-Dec-2011 David 'Digit' Turner <digit@google.com> libc: optimize pthread mutex lock/unlock operations (1/2)

This patch provides several small optimizations to the
implementation of mutex locking and unlocking. Note that
a following patch will get rid of the global recursion
lock, and provide a few more aggressive changes, I
though it'd be simpler to split this change in two parts.

+ New behaviour: pthread_mutex_lock et al now detect
recursive mutex overflows and will return EAGAIN in
this case, as suggested by POSIX. Before, the counter
would just wrap to 0.

- Remove un-necessary reloads of the mutex value from memory
by storing it in a local variable (mvalue)

- Remove un-necessary reload of the mutex value by passing
the 'shared' local variable to _normal_lock / _normal_unlock

- Remove un-necessary reload of the mutex value by using a
new macro (MUTEX_VALUE_OWNER()) to compare the thread id
for recursive/errorcheck mutexes

- Use a common inlined function to increment the counter
of a recursive mutex. Also do not use the global
recursion lock in this case to speed it up.

Change-Id: I106934ec3a8718f8f852ef547f3f0e9d9435c816
6c6de44f0479b202c39555f5c22ef8c494837d3c 07-Dec-2011 David 'Digit' Turner <digit@google.com> libc: optimize pthread_once() implementation.

This patch changes the implementation of pthread_once()
to avoid the use of a single global recursive mutex. This
should also slightly speed up the non-common case where
we have to call the init function, or wait for another
thread to finish the call.

Change-Id: I8a93f4386c56fb89b5d0eb716689c2ce43bdcad9
e4a21c89a8b24b32f7a2637b45522dfa59f2aaa4 05-Dec-2011 Bruce Beare <bruce.j.beare@intel.com> signal: Align the sigset_t size passed to from user space to kernel.

Pass kernel space sigset_t size to __rt_sigprocmask to workaround
the miss-match of NSIG/sigset_t definition between kernel and bionic.

Note: Patch originally from Google...
Change-Id: I4840fdc56d0b90d7ce2334250f04a84caffcba2a
Signed-off-by: Chenyang Du <chenyang.du@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
e480fc83b2887388d469eb3bf58c86c610f5b082 21-Sep-2011 Jack Ren <jack.ren@intel.com> bionic: fix pthread_{create, exit}/signal race condition

(1) in pthread_create:
If the one signal is received before esp is subtracted by 16 and
__thread_entry( ) is called, the stack will be cleared by kernel
when it tries to contruct the signal stack frame. That will cause
that __thread_entry will get a wrong tls pointer from the stack
which leads to the segment fault when trying to access tls content.

(2) in pthread_exit
After pthread_exit called system call unmap(), its stack will be
freed. If one signal is received at that time, there is no stack
available for it.

Fixed by subtracting the child's esp by 16 before the clone system
call and by blocking signal handling before pthread_exit is started.

Author: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
10c8ce59a40a1d8ae8f49145eca365b364aabe58 19-Nov-2011 Jeff Brown <jeffbrown@google.com> Add tgkill syscall.

Use tgkill instead of tkill to implement pthread_kill.
This is safer in the event that the thread has already terminated
and its id has been reused by a different process.

Change-Id: Ied715e11d7eadeceead79f33db5e2b5722954ac9
5f64df4bc3bc281f661d520773894c729c2b4835 17-Nov-2011 Nick Kralevich <nnk@google.com> ASLR: enable pthread stack location randomization

Allow the kernel to choose a memory location to put the
thread stack, rather than hard coding 0x10000000

Change-Id: Ib1f37cf0273d4977e8d274fbdab9431ec1b7cb4f
e31bfae2baa96742f998155ee26e56c826a8ce3a 15-Nov-2011 David 'Digit' Turner <digit@android.com> bionic: Do not use <sys/atomics.h> for platform code.

We're going to modify the __atomic_xxx implementation to provide
full memory barriers, to avoid problems for NDK machine code that
link to these functions.

First step is to remove their usage from our platform code.
We now use inlined versions of the same functions for a slight
performance boost.

+ remove obsolete atomics_x86.c (was never compiled)

NOTE: This improvement was benchmarked on various devices.
Comparing a pthread mutex lock + atomic increment + unlock
we get:

- ARMv7 emulator, running on a 2.4 GHz Xeon:
before: 396 ns after: 288 ns

- x86 emulator in KVM mode on same machine:
before: 27 ns after: 27 ns

- Google Nexus S, in ARMv7 mode (single-core):
before: 82 ns after: 76 ns

- Motorola Xoom, in ARMv7 mode (multi-core):
before: 121 ns after: 120 ns

The code has also been rebuilt in ARMv5TE mode for correctness.

Change-Id: Ic1dc72b173d59b2e7af901dd70d6a72fb2f64b17
9bf330b5676d0f60b3e4c3b8985494bcb1134e8b 14-Nov-2011 David 'Digit' Turner <digit@google.com> libc: fix the pthread_sigmask implementation

The old code didn't work because the kernel expects a 64-bit sigset_t
while the one provided by our ABI is only 32-bit. This is originally
due to the fact that the kernel headers themselves define sigset_t
as a 32-bit type when __KERNEL__ is not defined (apparently to cater
to libc5 or some similarly old C library).

We can't modify the size of sigset_t without breaking the NDK ABI,
so instead perform runtime translation during the call.

Change-Id: Ibfdc3cbceaff864af7a05ca193aa050047b4773f
d53cae0e45dafdb3a83ccc3675051c0aee532111 12-Jul-2011 Glenn Kasten <gkasten@google.com> Add non-NDK internal API __pthread_gettid

Tracking bugs 5267571 and 5090073 (for deadlock detection logs).

Change-Id: Icb90f91ec1525607551c2234ef921bf88296484f
3435fc600d8d78b63a355b519667c23f56d6611b 31-May-2011 James Rose <james.rose@intel.com> bionic, libthread_db x86 fixes

Orig-Change-Id: I3be997f5f1f6a894a3c200d4f325cf3bfd428c66
Author: James Rose <james.rose@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
8e551a6319e45dd5c8d03864f3330b45cf8551b7 28-Mar-2011 Bruce Beare <bruce.j.beare@intel.com> bionic, libthread_db x86 fixes

Change-Id: I3be997f5f1f6a894a3c200d4f325cf3bfd428c66
Author: James Rose <james.rose@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
5c8c00a95a6cdcd74ac32dadedf0cea2b1661169 20-Dec-2010 David 'Digit' Turner <digit@google.com> libc: Fix the definition of SIGRTMAX

After this change, SIGRTMAX will be set to 64 (instead of 32 currently).
Note that this doesn't change the fact that our sigset_t is still defined
as a 32-bit unsigned integer, so most functions that deal with this type
won't support real-time signals though.

Change-Id: Ie1e2f97d646f1664f05a0ac9cac4a43278c3cfa8
b1c9cc2f2d1b0478b07278cdef885cabf1cd2798 23-Sep-2010 Andy McFadden <fadden@android.com> Add memory barriers to pthread_once.

The implementation was using a double-checked locking approach that
could break on SMP.

In addition to the barriers I also switched to a volatile pointer. I
don't think this will matter unless gcc can conclude that _normal_lock
can't affect *once_control, but I figured it was better to be safe.
(It seems to have no impact whatsoever on the generated code.)

Bug 3022795.

Change-Id: Ib91da25d57ff5bee4288526e39d457153ef6aacd
b9e49ad56e5776ace7c6eab2e997d5b7acb16792 22-Sep-2010 Wink Saville <wink@google.com> Use a recursive lock for pthread_once. DO NOT MERGE.

Backport change I9fc8b790 from Master to Gingerbread

Change-Id: I5cf48fcd4efb7991ed82f87d9365c19655dc9b7f
e2ac89869f9b459faa22640fb1bb41e818c1dd55 02-Sep-2010 Andy McFadden <fadden@android.com> Add a memory barrier to cond var signaling.

This adds an explicit memory barrier to condition variable signaling.
It's a little murky as to whether it's strictly required, but it seems
like a wise thing to do.

Change-Id: Id0faa542d61e4b8ffa775e4adf68e4d7471f4fb7
a02b93bd75a9d156117264d88069566e447397e2 28-Jun-2010 David 'Digit' Turner <digit@google.com> libc: add sanity checks to pthread_mutex_destroy()

Change-Id: Iddb2204fa792fa9aca5f19838926dddbb09b74a2
ccc3d1eea124cbeb1ec2d711d5892db1dd4445d3 28-Jun-2010 Wink Saville <wink@google.com> Use a recursive lock for pthread_once.

bug: 2292366
Change-Id: I9fc8b790dcfcb30ca94a0beb340d43fe5cd6c22e
50ace4fec5e8cb5afcbc656a4556fa528adfd760 17-Jun-2010 David 'Digit' Turner <digit@google.com> Remove compiler warnings when building Bionic.

Also add missing declarations to misc. functions.
Fix clearerr() implementation (previous was broken).
Handle feature test macros like _POSIX_C_SOURCE properly.

Change-Id: Icdc973a6b9d550a166fc2545f727ea837fe800c4
6c8a2f2a5bc8d612ee953f528f2b5eb35983656a 11-Jun-2010 David 'Digit' Turner <digit@google.com> libc: remove cutils dependencies

We simply copy the stuff we need from cutils headers.

A future patch will change cutils to include the private <bionic_atomic_inline.h>

Change-Id: Ib6fd9a03bc9e337ce867bd606dc94c2b4438480a
6304d8b21891fd0cb7b5a4c25159a3d3b1709d62 03-Jun-2010 David 'Digit' Turner <digit@google.com> Use private futexes for semaphores, unless they are initialized with pshared != 0.

Change-Id: I534e36a7171cd37037ae03b910ba71ea6968286d
Note: previously, sem_init() would return an error if pshared != 0.
7c99c1856fce65c0394cd578c2a8ed37da2f288d 28-May-2010 Andy McFadden <fadden@android.com> Atomic/SMP update, part 3. (manual merge)

Update ARM atomic ops to use LDREX/STREX. Stripped out #if 0 chunk.

Insert explicit memory barriers in pthread and semaphore code.

For bug 2721865.

Change-Id: I595cc8e5a8d1e4906b6641115e46208a7e9e755a
fcd00ebbdf3e7f4e1e7782a65ae10fb0fc03a1aa 28-May-2010 Andy McFadden <fadden@android.com> Atomic/SMP update, part 3.

Update ARM atomic ops to use LDREX/STREX. Stripped out #if 0 chunk.

Insert explicit memory barriers in pthread and semaphore code.

For bug 2721865.

Change-Id: I0f153b797753a655702d8be41679273d1d5d6ae7
78c1c04ced772298be8bdb5a94b6ce491bb9b3e1 20-May-2010 André Goddard Rosa <andre.goddard@gmail.com> pthread: introduce pthread_setname_np() as a mean to give names to threads

... so that each cloned process at the kernel level can be named
independently. Tools like 'top' can display the CPU/memory statistics
for each process's thread if "Show Threads" mode is on.

With this function in place, we can convert dalvik/Thread.c setThreadName()
function over this function. This feature ought to be provided by the
underlying C library and not coded directly in Dalvik.

Change-Id: Ifa997665dbaa114e0b126f8c667708be9a4137fd
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
5207d78c321571b4b5ef3dd405198267a0d940b1 23-Mar-2010 David 'Digit' Turner <digit@google.com> Fix typo that broke recursive mutexes implementation.

Change-Id: I832901604b487c6a50304c311b5ba135e153530d
b5e4a416060aa7f0a1e2a9ad5b8e318d59986852 20-Mar-2010 David 'Digit' Turner <digit@google.com> pthread: Use private futexes by default in condition variables

Now that the system properly uses shared condvars when needed, we
can enable the use of private futexes for them too.

Change-Id: Icf8351fc0a2309f764cba45c65bc3af047720cdf
88f06cd84a70f8a5212cb03272ec2c7cf0017afa 19-Mar-2010 David 'Digit' Turner <digit@google.com> Use private futexes for pthread_mutex_t.

This does not change the implementation of conditional variables
since we're waiting for other system components to properly use
pthread_condattr_init/setpshared before that.

Also remove an obsolete x86 source file.

Change-Id: Ia3e3fbac35b87a534fb04d4381c3c66b975bc8f7
ee7b077abf1d99503b986489ad93374a057cb354 18-Mar-2010 David 'Digit' Turner <digit@google.com> Add pthread_condattr_init/destroy/setpshared/getpshared

Note that this does not change the implementation of conditional variables
which still use shared futexes, independent on the flags being selected.

This will be fixed in a later patch, once our system is modified to use
pthread_condattr_setpshared(attr, PTHREAD_PROCESS_SHARED) properly.

Change-Id: I935de50964cd41f97a13dbfd6626d3407b0406c3
40e6b822866ee59f7823000384321bb899416cb1 17-Mar-2010 David 'Digit' Turner <digit@google.com> Fix indentation in pthread mutex implementation.

This is preliminary work to simplify later changes to support
private futexes.

Change-Id: I06750936a93747a5e3f5a10228cbdc29e39c528c
8641833b62e3b319796dc80ea16eb1592c05edf6 11-Mar-2010 Fabrice Di Meglio <fdimeglio@google.com> Revert "bionic: pthread: use private futexes by default for mutexes and condvars"

This reverts commit ba9c6f0989ae94778ba2b9f597adc827c9dc81e8.
ba9c6f0989ae94778ba2b9f597adc827c9dc81e8 11-Mar-2010 David 'Digit' Turner <digit@google.com> bionic: pthread: use private futexes by default for mutexes and condvars

Private futexes are a recent kernel addition: faster futexes that cannot be
shared between processes. This patch uses them by default, unless the PROCESS_SHARED
attribute flag is used when creating a mutex and/or conditional variable.

Also introduces pthread_condattr_init/destroy/setpshared/getpshared.

Change-Id: I3a0e2116f467072b046524cb5babc00e41057a53
8f8b5310d2c3fe8782377bd66b65ed14dc6511a4 01-Mar-2010 David 'Digit' Turner <digit@google.com> Fix pthread_sigmask() to return correct error values.

Before that, it returned -1 on error and set errno (not Posix)
After the patch, it returns the error code and leaves errno untouched.
a28336c73542f5df1c03de4c142070f408e8d5aa 05-Feb-2010 André Goddard Rosa <andre.goddard@gmail.com> bionic: on pthread_join(), avoid extra check in case we find the thread

... by using similar logic as used in pthread_detach().

Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
194d3fa048cf909ca592dd56fa538dc9cd3f5ddb 13-Nov-2009 Jean-Baptiste Queru <jbq@google.com> eclair snapshot
bc10cd2900cdb7fed077163b6a33e0f8572b2b19 24-Sep-2009 David 'Digit' Turner <digit@google.com> Fix a typo that resulted in a crash in the boot sequence
3f56b7f65adb9ee35cd0f878ca00b92011eec427 22-Sep-2009 David 'Digit' Turner <digit@google.com> Add pthread_mutex_lock_timeout_np

This is used to perform a mutex lock for a given amount of
milliseconds before giving up. Using the _np prefix since this
is absolutely not portable.

Also remove a compiler warning in pthread_attr_getstackaddr
a4e67f4512e2609c13a67d569bff14001413a042 27-Dec-2008 Matthieu CASTET <matthieu.castet@gmail.com> Remove code duplication for pthread_cond_timeout_np : use __pthread_cond_timedwait_relative helper
b7681167cbe91c2bb95cccdc08f75184ed1fb839 14-Jul-2009 Mathias Agopian <mathias@google.com> allow pthread_mutexattr_setpshared to accept SHARED mutexes, since our current impl actually uses shared mutexes
a2f5e212448f36f0b35cf695d13bb4defdb4472e 14-Jul-2009 Mathias Agopian <mathias@google.com> added pthread_cond_timedwait_relative_np()
1dc9e472e19acfe6dc7f41e429236e7eef7ceda1 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
1767f908af327fa388b1c66883760ad851267013 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
9f65adf2ba3bb15feb8b7a7b3eef788df3fd270e 11-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@130745
e5cc1f386b167b9f7bfdebc7219e89aa9b71e4b2 16-Jan-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@126645
4e468ed2eb86a2406e14f1eca82072ee501d05fd 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
a27d2baa0c1a2ec70f47ea9199b1dd6762c8a349 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution