I cannot replicate results in Listing 4-7 with code in Listing 4-6. "Tracer" (line 17) is not recognized as an object when using "thread_local" keyword; however, "Tracer" is recognized when I use "static" keyword and I get the output in Listing 4-7. I added the "thread" header file, #include <thread>, and it still did not work. Both clang++ and g++ are up to date which should support threading. Help is appreciated.
I cannot replicate results in Listing 4-7 with code in Listing 4-6. "Tracer" (line 17) is not recognized as an object when using "thread_local" keyword; however, "Tracer" is recognized when I use "static" keyword and I get the output in Listing 4-7. I added the "thread" header file,
#include <thread>, and it still did not work. Both clang++ and g++ are up to date which should support threading. Help is appreciated.