summaryrefslogtreecommitdiffstats
path: root/base/threading
diff options
context:
space:
mode:
authormichaelbai@google.com <michaelbai@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-02 16:11:16 +0000
committermichaelbai@google.com <michaelbai@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-02 16:11:16 +0000
commit61c86c6a23ab32e81337f66f1b958d8ec3e8bd45 (patch)
tree64f18cd34be5ad9ec1140c3e334f5483af8af462 /base/threading
parenteccefee0229e222c0130dca22412b4dccfa3f181 (diff)
downloadchromium_src-61c86c6a23ab32e81337f66f1b958d8ec3e8bd45.zip
chromium_src-61c86c6a23ab32e81337f66f1b958d8ec3e8bd45.tar.gz
chromium_src-61c86c6a23ab32e81337f66f1b958d8ec3e8bd45.tar.bz2
Android's paths and message loop implementation with JNI
BUG= TEST= Review URL: http://codereview.chromium.org/7518032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95085 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/threading')
-rw-r--r--base/threading/platform_thread_posix.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/base/threading/platform_thread_posix.cc b/base/threading/platform_thread_posix.cc
index 497acb5..baa3ab1 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());