CeTlsFree (Compact 2013)
This function releases the slot value in the current thread and calls the cleanup function, if one was specified.
Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.
Call this function in your DLL_THREAD_DETACH code to properly cleanup any TLS value stored for the given slot in the exiting thread. It is assumed that this call is always made from DLL_THREAD_DETACH code as the cleanup function associated with this slot index is called without holding any locks.
If the threads of the process have allocated dynamic storage and used the TLS index to store pointers to this storage, they should free the storage before calling CeTlsFree. This function does not free dynamic storage that has been associated with the TLS index.
For a brief discussion of typical uses of the TLS functions, see the Remarks section of the TlsAlloc function.