I want to be able to set my own thread IDs, so for example, for the four threads I create in an application, I want to have their ID as 0, 1, 2 and 3. I know you can use a thread local variable and assign it the ID. However, for some reason, I can't use thread local variable. You could say, passing thread ID as argument to the thread function could do the trick, but in that case you need to pass the thread ID in every function used by the thread, which is ofcourse not viable.

A little searching on google showed me **set\_tid\_address**, that looks interesting by its name, but I'm not sure if it could fulfill my purpose, as its documentation is not clear. Any ideas, how to achieve this?