TlsFree

TlsFree releases a thread local storage (TLS) index, making it available for reuse.

Syntax

BOOL TlsFree(
    DWORD TlsIndex
);

Parameters

TlsIndex

The TLS index that was allocated by TlsAlloc.

Return Value

TRUE if the function succeeds, FALSE if the function fails

To get extended error information, call GetLastError.

Remarks

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 TlsFree. The TlsFree function does not free any dynamic storage that has been associated with the TLS index. It is expected that DLLs call this function (if at all) only during their process detach routine.

For a brief discussion of typical uses of the TLS functions, see the Comments section of TlsAlloc.

Requirements

Minimum Supported Version RTX64 2013
Header windows.h
Library Rtx_Rtss.lib

See Also:

TlsAlloc

TlsGetValue

TlsSetValue