Index: src/trusted/service_runtime/nacl_app_thread.c |
=================================================================== |
--- src/trusted/service_runtime/nacl_app_thread.c (revision 10790) |
+++ src/trusted/service_runtime/nacl_app_thread.c (working copy) |
@@ -23,7 +23,11 @@ |
#include "native_client/src/trusted/service_runtime/nacl_stack_safety.h" |
#include "native_client/src/trusted/service_runtime/nacl_syscall_common.h" |
+#if NACL_OSX |
Mark Seaborn
2013/02/14 00:37:54
I'd be inclined to put this #if into the header so
|
+#include "native_client/src/trusted/service_runtime/osx/mach_thread_map.h" |
+#endif |
+ |
void WINAPI NaClAppThreadLauncher(void *state) { |
struct NaClAppThread *natp = (struct NaClAppThread *) state; |
uint32_t thread_idx; |
@@ -43,6 +47,8 @@ |
nacl_user[thread_idx] = &natp->user; |
#if NACL_WINDOWS |
nacl_thread_ids[thread_idx] = GetCurrentThreadId(); |
+#elif NACL_OSX |
+ SetCurrentMachThreadForNaClThreadIndex(thread_idx); |
#endif |
/* |
@@ -122,6 +128,8 @@ |
nacl_user[thread_idx] = NULL; |
#if NACL_WINDOWS |
nacl_thread_ids[thread_idx] = 0; |
+#elif NACL_OSX |
+ ClearMachThreadForNaClThreadIndex(thread_idx); |
#endif |
NaClLog(3, " removing thread from thread table\n"); |