| Index: base/threading/platform_thread_posix.cc
|
| diff --git a/base/threading/platform_thread_posix.cc b/base/threading/platform_thread_posix.cc
|
| index 497acb5efdf7787ea03cace75b0c398931029a0e..baa3ab1e7e42d7843265123fb3685088f5b6a333 100644
|
| --- a/base/threading/platform_thread_posix.cc
|
| +++ b/base/threading/platform_thread_posix.cc
|
| @@ -25,6 +25,10 @@
|
| #include <unistd.h>
|
| #endif
|
|
|
| +#if defined(OS_ANDROID)
|
| +#include "base/android/jni_android.h"
|
| +#endif
|
| +
|
| #if defined(OS_NACL)
|
| #include <sys/nacl_syscalls.h>
|
| #endif
|
| @@ -49,6 +53,9 @@ void* ThreadFunc(void* params) {
|
| base::ThreadRestrictions::SetSingletonAllowed(false);
|
| delete thread_params;
|
| delegate->ThreadMain();
|
| +#if defined(OS_ANDROID)
|
| + base::android::DetachFromVM();
|
| +#endif
|
| return NULL;
|
| }
|
|
|
| @@ -124,6 +131,8 @@ PlatformThreadId PlatformThread::CurrentId() {
|
| return mach_thread_self();
|
| #elif defined(OS_LINUX)
|
| return syscall(__NR_gettid);
|
| +#elif defined(OS_ANDROID)
|
| + return gettid();
|
| #elif defined(OS_FREEBSD)
|
| // TODO(BSD): find a better thread ID
|
| return reinterpret_cast<int64>(pthread_self());
|
|
|