From 0751639191eacedce3b622837dea475718cf3fd8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Wed, 24 Oct 2012 16:48:55 +0100 Subject: [PATCH] Use compiler TLS for GL tracing. --- wrappers/gltrace_state.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/wrappers/gltrace_state.cpp b/wrappers/gltrace_state.cpp index 5c7ad1b..68bda10 100644 --- a/wrappers/gltrace_state.cpp +++ b/wrappers/gltrace_state.cpp @@ -57,15 +57,13 @@ public: } }; -static os::thread_specific_ptr thread_state; +static thread_specific ThreadState *thread_state; static ThreadState *get_ts(void) { - ThreadState *ts = thread_state.get(); - + ThreadState *ts = thread_state; if (!ts) { - ts = new ThreadState; - thread_state.reset(ts); + thread_state = ts = new ThreadState; } return ts; -- 2.43.0