<div dir="ltr">One of the next things I wanted to cleanup is the use of Thread local storage.  LLVM already provides a ThreadLocal class, so simialr to how I cleaned up the DynamicLibrary stuff to use LLVM's DynamicLibrary, I wanted to do the same with ThreadLocal.  <div><br></div><div>There's a catch though.  Timer makes use of pthreads' thread-local storage destructors, and this isn't supported on all platforms.  I'm wondering how critical is this really?<div><br></div><div>It looks like the thread local storage entry is created in Timer::Initialize(), and the only place in the code that Timer::Initialize() is called is from lldb_private::Initialize.  Based on this, I actually think that maybe the fact that it's using TLS at all is just a historical carry-over and not actually necessary anymore since it's only being used from a single thread.  If this is true, there's no reason to even use TLS, I could just make a static member and cleanup with a call to Timer::Shutdown().</div></div><div><br></div><div>This would solve the portability issue since TLS destructors would no longer be needed, and making porting all of our TLS code to use llvm support libraries very easy.</div><div><br></div><div>Does this assessment seem correct?  Or am I missing something?</div></div>