I read a note in the book C How to Program 7th about some new standard C storage class named _Thread_local
:
The new C standard adds storage class specifier
_Thread_local
, which is beyond this book's scope.
I looked for it in Google and here but nothing show up. Could someone please provide me some link about it?
_Thread_local
was added in C11 and the new standard header which contains this is<threads.h>
. You can look at standard for information. GCC doesn't have it yet. You'll have to find a compiler that implements this C11 feature. – Lorentz__thread
and other compilers might have it as__declspec(thread)
. Usually a simple#define
of_Thread_local
does the trick. – Swinish<threads.h>
. GCC 9 definitely supports it, but I don't know about GCC 8. – Miscarry