diff options
author | Virgile Bello <virgile.bello@gmail.com> | 2013-08-23 12:44:05 +0000 |
---|---|---|
committer | Virgile Bello <virgile.bello@gmail.com> | 2013-08-23 12:44:05 +0000 |
commit | b2f1fb2943c5e6833dcd2e1166b83ae4aca06d7a (patch) | |
tree | 2cf9567a828318ccccd4df22f7af31b4e796e5ec /lldb/source/Core/Timer.cpp | |
parent | fcfa0afd7a09133d00bdc047cf894fce005a287a (diff) | |
download | bcm5719-llvm-b2f1fb2943c5e6833dcd2e1166b83ae4aca06d7a.tar.gz bcm5719-llvm-b2f1fb2943c5e6833dcd2e1166b83ae4aca06d7a.zip |
MingW compilation (windows). Includes various refactoring to improve portability.
llvm-svn: 189107
Diffstat (limited to 'lldb/source/Core/Timer.cpp')
-rw-r--r-- | lldb/source/Core/Timer.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lldb/source/Core/Timer.cpp b/lldb/source/Core/Timer.cpp index b1416bdaf62..bbd990056ba 100644 --- a/lldb/source/Core/Timer.cpp +++ b/lldb/source/Core/Timer.cpp @@ -14,6 +14,7 @@ #include "lldb/Core/Stream.h" #include "lldb/Host/Mutex.h" +#include "lldb/Host/Host.h" #include <stdio.h> @@ -26,7 +27,7 @@ uint32_t Timer::g_display_depth = 0; FILE * Timer::g_file = NULL; typedef std::vector<Timer *> TimerStack; typedef std::map<const char *, uint64_t> TimerCategoryMap; -static pthread_key_t g_key; +static lldb::thread_key_t g_key; static Mutex & GetCategoryMutex() @@ -46,11 +47,11 @@ GetCategoryMap() static TimerStack * GetTimerStackForCurrentThread () { - void *timer_stack = ::pthread_getspecific (g_key); + void *timer_stack = Host::ThreadLocalStorageGet(g_key); if (timer_stack == NULL) { - ::pthread_setspecific (g_key, new TimerStack); - timer_stack = ::pthread_getspecific (g_key); + Host::ThreadLocalStorageSet(g_key, new TimerStack); + timer_stack = Host::ThreadLocalStorageGet(g_key); } return (TimerStack *)timer_stack; } @@ -71,8 +72,7 @@ void Timer::Initialize () { Timer::g_file = stdout; - ::pthread_key_create (&g_key, ThreadSpecificCleanup); - + g_key = Host::ThreadLocalStorageCreate(ThreadSpecificCleanup); } Timer::Timer (const char *category, const char *format, ...) : |