summaryrefslogtreecommitdiffstats
path: root/source/Core/Timer.cpp
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2013-11-06 16:48:53 +0000
committeremaste <emaste@FreeBSD.org>2013-11-06 16:48:53 +0000
commitc727fe695d28799acb499e9961f11ec07d4f9fe2 (patch)
tree56d79f94966870db1cecd65a7264510a25fd1cba /source/Core/Timer.cpp
parent2e8c9206a971efee1b77ad2ae852265d6f4ecaa0 (diff)
downloadFreeBSD-src-c727fe695d28799acb499e9961f11ec07d4f9fe2.zip
FreeBSD-src-c727fe695d28799acb499e9961f11ec07d4f9fe2.tar.gz
Import lldb as of SVN r194122
Sponsored by: DARPA, AFRL
Diffstat (limited to 'source/Core/Timer.cpp')
-rw-r--r--source/Core/Timer.cpp12
1 files changed, 6 insertions, 6 deletions
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 <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, ...) :
OpenPOWER on IntegriCloud