Share via


IThreadProxy::YieldToSystem Method

Causes the calling thread to yield execution to another thread that is ready to run on the current processor. The operating system selects the next thread to be executed.

virtual void YieldToSystem() = 0;

Remarks

When called by a thread proxy backed by a regular Windows thread, YieldToSystem behaves exactly like the Windows function SwitchToThread. However, when called from user-mode schedulable (UMS) threads, the SwitchToThread function delegates the task of picking the next thread to run to the user mode scheduler, not the operating system. To achieve the desired effect of switching to a different ready thread in the system, use YieldToSystem.

YieldToSystem must be called on the IThreadProxy interface that represents the currently executing thread or the results are undefined.

Requirements

Header: concrtrm.h

Namespace: Concurrency

See Also

Reference

IThreadProxy Structure