Windows Mobile 6.5
A version of this page is also available for

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

VOID WINAPI SwitchToFiber(
  LPVOID lpFiber


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

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() );
This call is a no-operation instruction in Windows Embedded CE.

Windows Embedded CEWindows CE .NET 4.0 and later
Windows MobileWindows Mobile Version 5.0 and later

Community Additions