Make __get_thread inlined.
Bug: 19825434
Change-Id: Ifb672a45a5776b83625a25654ed0d6f7fc368ae3
diff --git a/libc/bionic/ndk_cruft.cpp b/libc/bionic/ndk_cruft.cpp
index 109c523..8b34495 100644
--- a/libc/bionic/ndk_cruft.cpp
+++ b/libc/bionic/ndk_cruft.cpp
@@ -346,6 +346,14 @@
return malloc(size);
}
+#define __get_thread __real_get_thread
+#include "pthread_internal.h"
+#undef __get_thread
+// Various third-party apps contain a backport of our pthread_rwlock implementation that uses this.
+extern "C" pthread_internal_t* __get_thread() {
+ return __real_get_thread();
+}
+
#endif // !defined(__LP64__)
// This is never implemented in bionic, only needed for ABI compatibility with the NDK.