From: José Fonseca Date: Wed, 24 Oct 2012 15:48:55 +0000 (+0100) Subject: Use compiler TLS for GL tracing. X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=0751639191eacedce3b622837dea475718cf3fd8;p=apitrace Use compiler TLS for GL tracing. --- 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;