Thread variables in C?

Caporegime
Joined
12 Mar 2004
Posts
29,962
Location
England
I need to know how to implement thread local storage in C using pthreads. How do I assign a variable to the created threads? I know that there is a " __thread" keyword, I'm just not totally sure how to use it. Can I just type " __thread int data = 0;" before the thread is created?
 
Back
Top Bottom