NtYieldExecution - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTKEAPI_H
#if (PHNT_MODE != PHNT_MODE_KERNEL)

/**
 * Offers the current thread's processor execution opportunity to an eligible
 * ready thread. This is a scheduler hint, not a delay of a specified duration,
 * an alertable object wait, or a synchronization operation.
 *
 * \return STATUS_SUCCESS (0) if the yield path succeeds, or the informational
 * STATUS_NO_YIELD_PERFORMED (0x40000024) if no yield is performed. Neither status
 * establishes that a particular other thread ran or completed work.
 * \remarks The x64 entry calls KeYieldExecution with flags 0
 * and returns its status. The scheduler inspects both the current processor's
 * ready summary and its shared ready queue; a no-yield result is not proof that
 * there are no runnable threads anywhere in the system. Use an actual waitable
 * object or another synchronization primitive when another thread's progress matters.
 */
_Kernel_entry_
NTSYSCALLAPI
NTSTATUS
NTAPI
NtYieldExecution(
    VOID
    );

#endif
#endif

View code on GitHub
#ifndef _NTZWAPI_H

_Kernel_entry_
NTSYSCALLAPI
NTSTATUS
NTAPI
ZwYieldExecution(
    VOID
    );

#endif

View code on GitHub

NtDoc

No description available.

NTinternals.net (undocumented.ntinternals.net)

This function stop executing of calling thread, and switch to any other currently running thread.

Documented by