FlsFree function (fibersapi.h)

Releases a fiber local storage (FLS) index, making it available for reuse.

Syntax

BOOL FlsFree(
  [in] DWORD dwFlsIndex
);

Parameters

[in] dwFlsIndex

The FLS index that was allocated by the FlsAlloc function.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

Freeing an FLS index frees the index for all instances of FLS in the current process. Freeing an FLS index also causes the associated callback routine to be called for each fiber, if the corresponding FLS slot contains a non-NULL value.

If the fibers of the process have allocated memory and stored a pointer to the memory in an FLS slot, they should free the memory before calling FlsFree. The FlsFree function does not free memory blocks whose addresses have been stored in the FLS slots associated with the FLS index. It is expected that DLLs call this function (if at all) only during DLL_PROCESS_DETACH.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2003 [desktop apps | UWP apps]
Target Platform Windows
Header fibersapi.h
Library Kernel32.lib
DLL Kernel32.dll

See also

Fibers

FlsAlloc

Process and Thread Functions