1 out of 2 rated this helpful - Rate this topic

FlsFree function

Applies to: desktop apps | Metro style apps

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

Syntax

BOOL WINAPI FlsFree(
  __in  DWORD dwFlsIndex
);

Parameters

dwFlsIndex [in]

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

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2003

Header

WinBase.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

See also

Fibers
FlsAlloc
Process and Thread Functions

 

 

Send comments about this topic to Microsoft

Build date: 3/7/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ