From c727fe695d28799acb499e9961f11ec07d4f9fe2 Mon Sep 17 00:00:00 2001 From: emaste Date: Wed, 6 Nov 2013 16:48:53 +0000 Subject: Import lldb as of SVN r194122 Sponsored by: DARPA, AFRL --- source/Core/Timer.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source/Core/Timer.cpp') diff --git a/source/Core/Timer.cpp b/source/Core/Timer.cpp index b1416bd..bbd9900 100644 --- a/source/Core/Timer.cpp +++ b/source/Core/Timer.cpp @@ -14,6 +14,7 @@ #include "lldb/Core/Stream.h" #include "lldb/Host/Mutex.h" +#include "lldb/Host/Host.h" #include @@ -26,7 +27,7 @@ uint32_t Timer::g_display_depth = 0; FILE * Timer::g_file = NULL; typedef std::vector TimerStack; typedef std::map 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, ...) : -- cgit v1.1