RtkWaitForSingleObject

RtkWaitForSingleObject returns when one of the following occurs:

Syntax

ULONG RtkWaitForSingleObject(
    RTSSINST RtssInst,
    PULONG pErrorCode,
    HANDLE hHandle,
    DWORD Milliseconds
);

Parameters

RtssInst

An RTSSINST value returned from a call to RtkRtssAttach.

pErrorCode

A pointer to a location where additional error information may be returned. This location need not be defined; the user may pass a NULL value. If defined, this location is set to NULL if no error occurred.

hHandle

The object identifier. See the list of the object types whose handles can be specified in the Comments section.

Milliseconds

The time-out interval, in milliseconds. The function returns if the interval elapses, even if the object's state is non-signaled. If Milliseconds is zero, the function tests the object's state and returns immediately. If Milliseconds is INFINITE, the function's time-out interval never elapses.

Return Values

The event that caused the function to return if the function succeeds, WAIT_FAILED if the function fails

The return value on success is one of the following values:

Remarks

RtkWaitForSingleObject checks the current state of the specified object. If the object's state is non-signaled, the calling thread enters an efficient wait state. The thread consumes very little processor time while waiting for the object state to become signaled or the time-out interval to elapse.

Before returning, a wait function modifies the state of some types of synchronization objects. Modification occurs only for the object or objects whose signaled state caused the function to return. For example, the count of a semaphore object is decreased by one.

RtkWaitForSingleObject can wait for the following objects:

Requirements

Header Rtkapi.h
Library rtx_rtk.lib

See Also:

RtkCreateMutex

RtkCreateSemaphore

RtkOpenMutex

RtkOpenSemaphore

IntervalZero.com | Support | Give Feedback