Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
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 ConvertThreadToFiberto set up an area to save the fiber state information in. The thread becomes the currently executing fiber.

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

You can call SwitchToFiberwith 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 CreateFiberand you must use proper synchronization.

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

Avoid making the following call:

Copy Code
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