Expand Minimize

FlsFree function

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 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2003 [desktop apps | Windows Store apps]

Header

WinBase.h on Windows Vista, Windows 7, Windows Server 2008, and Windows Server 2008 R2 (include Windows.h);
Fibersapi.h on Windows 8 and Windows Server 2012

Library

Kernel32.lib

DLL

Kernel32.dll

See also

Fibers
FlsAlloc
Process and Thread Functions

 

 

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.