INtime SDK Help
WaitForRtControl
INtime SDK v7.1 > About INtime > INtime Kernel > Regions > WaitForRtControl

Gains ownership of a region. This function blocks until the current owner gives up the region.

WaitForRtControl enables a thread to wait until a region becomes available. If access does not become available, the thread never runs again. An error occurs if a thread requests control of a region it already controls.

BOOLEAN WaitForRtControl(
    RTHANDLE hRegion
);

Parameters

hRegion
Handle for the region for which ownership is required.

Remarks

If no thread currently has control of the specified region, entry is immediate. If another thread currently has control, the calling thread enters the region's thread queue and goes to sleep. The thread remains asleep until it receives control of the specified region.

If the region has a priority-based thread queue, the priority of the thread currently having control is temporarily boosted, if necessary, to match that of the thread at the head of the queue.

Return Values

TRUE
Success.
FALSE
Failure. To determine the status, call GetLastRtError.

Status

E_OK 0x0000
No exceptional conditions occurred.
E_CONTEXT 0x0005
hRegion specifies a region already accessed by the calling thread.
E_EXIST 0x0006
You used an invalid value for hRegion.
E_TYPE 0x8002
hRegion is not a region handle.

Requirements

Versions Defined in Include Link to
INtime 3.0 intime/rt/include/rtbase.h rt.h rt.lib

See Also

Region system calls, AcceptRtControl