Thread Local Storage initialization

In a reenterant function, which can be used by many threads, I wouls like to have a variable which will be static if used in a single thread. So it looks like vTaskSetThreadLocalStoragePointer(), and pvTaskGetThreadLocalStoragePointer(), can do this for me. I just cna’t initialize the variable, can I assum ist is initialized to NULL?

Thread Local Storage initialization

Not sure if this answers your question – but when a task is created all of its thread local storage pointers are set to NULL – which if you interpret the pointers as a variable – will mean each thread local variable starts with the value 0.

Thread Local Storage initialization

Yes it does. Thanks.