c/thread/tss create

Creates new thread-specific storage key and stores it in the object pointed to by. Although the same key value may be used by different threads, the values bound to the key by tss_set are maintained on a per-thread basis and persist for the life of the calling thread.

The value null is associated with the newly created key in all existing threads, and upon thread creation, the values associated with all TSS keys is initialized to null.

If is not a null pointer, then also associates the destructor which is called when the storage is released by thrd_exit (but not by tss_delete and not at program termination by exit).

A call to from within a thread-specific storage destructor results in undefined behavior.

Return value
thrd_success if successful, thrd_error otherwise.