OSDN Git Service

Add pthread_gettid_np and re-expose __get_thread for LP32.
authorElliott Hughes <enh@google.com>
Thu, 11 Sep 2014 23:11:43 +0000 (16:11 -0700)
committerElliott Hughes <enh@google.com>
Thu, 11 Sep 2014 23:22:50 +0000 (16:22 -0700)
commita4831cb4a3f44b93788488db8ff9ea76613f0355
treeeaa225c537d468307739bc48bbc86e241ada58e0
parentea66004c4a051e40c49314d808e7359634f6c641
Add pthread_gettid_np and re-expose __get_thread for LP32.

A lot of third-party code calls the private __get_thread symbol,
often as part of a backport of bionic's pthread_rwlock implementation.
Hopefully this will go away for LP64 (since you're guaranteed the
real implementation there), but there are still APIs that take a tid
and no way to convert between a pthread_t and a tid. pthread_gettid_np
is a public API for that. To aid the transition, make __get_thread
available again for LP32.

(cherry-pick of 27efc48814b8153c55cbcd0af5d9add824816e69.)

Bug: 14079438
Change-Id: I43fabc7f1918250d31d4665ffa4ca352d0dbeac1
libc/Android.mk
libc/bionic/posix_timers.cpp
libc/bionic/pthread_gettid_np.cpp [new file with mode: 0644]
libc/bionic/pthread_internal.h
libc/bionic/pthread_internals.cpp
libc/include/pthread.h