Added c++11 thread local storage