Compartir a través de


SwitchToFiber

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This function schedules a fiber. The caller must be a fiber.

Syntax

VOID WINAPI SwitchToFiber(
  LPVOID lpFiber
);

Parameters

  • lpFiber
    [in] Specifies the address of the fiber to be scheduled.

Return Value

None.

Remarks

Create fibers with CreateFiber.

Before you can schedule fibers associated with a thread, you must call ConvertThreadToFiber to set up an area to save the fiber state information in. The thread becomes the currently executing fiber.

The SwitchToFiber function saves the state information of the current fiber and restores the state of the specified fiber.

You can call SwitchToFiber with the address of a fiber created by a different thread. To do this, you must have the address returned to the other thread when it called CreateFiber and you must use proper synchronization.

If you call SwitchToFiber with an invalid pointer or a NULL pointer, the result is undefined.

Avoid making the following call:

SwitchToFiber( GetCurrentFiber() );

Note

This call is a no-operation instruction in Windows Embedded CE.

Requirements

Header winbase.h
Library coredll.lib
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

Fiber Functions
ConvertThreadToFiber
CreateFiber