Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(935)

Unified Diff: base/threading/platform_thread_posix.cc

Issue 7518032: Android's paths and message loop implementation with JNI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix dependence again. Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« base/message_loop.h ('K') | « base/message_pump_android.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« base/message_loop.h ('K') | « base/message_pump_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698