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

Unified Diff: src/trusted/service_runtime/nacl_app_thread.c

Issue 12218089: Remove nacl_user[] array lookup from syscall code path on x86-64 and MIPS (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Created 7 years, 10 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
Index: src/trusted/service_runtime/nacl_app_thread.c
diff --git a/src/trusted/service_runtime/nacl_app_thread.c b/src/trusted/service_runtime/nacl_app_thread.c
index 4667aa87765ef3f8ac62231ece130770e2c14500..bf7f4ac246564fdb0bbe191e3c941cf6af57996d 100644
--- a/src/trusted/service_runtime/nacl_app_thread.c
+++ b/src/trusted/service_runtime/nacl_app_thread.c
@@ -39,7 +39,7 @@ void WINAPI NaClAppThreadLauncher(void *state) {
thread_idx = NaClGetThreadIdx(natp);
CHECK(0 < thread_idx);
CHECK(thread_idx < NACL_THREAD_MAX);
- NaClTlsSetIdx(thread_idx);
+ NaClTlsSetCurrentThread(natp);
nacl_user[thread_idx] = &natp->user;
#if NACL_WINDOWS
nacl_thread_ids[thread_idx] = GetCurrentThreadId();
@@ -123,6 +123,7 @@ void NaClAppThreadTeardown(struct NaClAppThread *natp) {
#if NACL_WINDOWS
nacl_thread_ids[thread_idx] = 0;
#endif
+ NaClTlsSetCurrentThread(NULL);
NaClLog(3, " removing thread from thread table\n");
/* Deallocate the ID natp->thread_num. */

Powered by Google App Engine
This is Rietveld 408576698