Export (0) Print
Expand All
Expand Minimize

ConvertThreadToFiberEx function

Converts the current thread into a fiber. You must convert a thread into a fiber before you can schedule other fibers.

Syntax


LPVOID WINAPI ConvertThreadToFiberEx(
  _In_opt_ LPVOID lpParameter,
  _In_     DWORD  dwFlags
);

Parameters

lpParameter [in, optional]

A pointer to a variable that is passed to the fiber. The fiber can retrieve this data by using the GetFiberData macro.

dwFlags [in]

If this parameter is zero, the floating-point state on x86 systems is not switched and data can be corrupted if a fiber uses floating-point arithmetic. If this parameter is FIBER_FLAG_FLOAT_SWITCH, the floating-point state is switched for the fiber.

Return value

If the function succeeds, the return value is the address of the fiber.

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

Remarks

Only fibers can execute other fibers. If a thread needs to execute a fiber, it must call ConvertTheadToFiber or ConvertThreadToFiberEx to create an area in which to save fiber state information. The thread is now the current fiber. The state information for this fiber includes the fiber data specified by lpParameter.

To compile an application that uses this function, define _WIN32_WINNT as 0x0400 or later. For more information, see Using the Windows Headers.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

WinBase.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

See also

ConvertFiberToThread
Fibers
GetFiberData
Process and Thread Functions

 

 

Community Additions

ADD
Show:
© 2015 Microsoft