Use Host::GetCurrentThreadID() instead of mach_thread_self().

llvm-svn: 105811
This commit is contained in:
Eli Friedman 2010-06-11 04:29:29 +00:00
parent 50fac2f7b5
commit e01b70bf30
1 changed files with 2 additions and 3 deletions

View File

@ -8,7 +8,6 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// C Includes // C Includes
#include <mach/mach.h>
#include <pthread.h> #include <pthread.h>
#include <stdio.h> #include <stdio.h>
#include <stdarg.h> #include <stdarg.h>
@ -206,12 +205,12 @@ Log::PrintfWithFlagsVarArg (uint32_t flags, const char *format, va_list args)
// Add the process and thread if requested // Add the process and thread if requested
if (log_options & LLDB_LOG_OPTION_PREPEND_PROC_AND_THREAD) if (log_options & LLDB_LOG_OPTION_PREPEND_PROC_AND_THREAD)
header.Printf ("[%4.4x/%4.4x]: ", getpid(), mach_thread_self()); header.Printf ("[%4.4x/%4.4x]: ", getpid(), Host::GetCurrentThreadID());
// Add the process and thread if requested // Add the process and thread if requested
if (log_options & LLDB_LOG_OPTION_PREPEND_THREAD_NAME) if (log_options & LLDB_LOG_OPTION_PREPEND_THREAD_NAME)
{ {
const char *thread_name_str = Host::GetThreadName (getpid(), mach_thread_self()); const char *thread_name_str = Host::GetThreadName (getpid(), Host::GetCurrentThreadID());
if (thread_name_str) if (thread_name_str)
header.Printf ("%s ", thread_name_str); header.Printf ("%s ", thread_name_str);
} }