ReXGlue SDK
Loading...
Searching...
No Matches
rex::kernel::IObjectWaiter Class Referenceabstract

#include <rex/kernel/thread_registry.h>

Public Member Functions

virtual rex::platform::WaitResult WaitHostObject (rex::platform::WaitHandle *handle, std::chrono::milliseconds timeout)=0
virtual X_STATUS WaitGuestObject (X_HANDLE handle, u32 wait_reason, u32 processor_mode, u32 alertable, u64 *opt_timeout)=0
virtual X_STATUS WaitGuestObjects (std::span< const X_HANDLE > handles, u32 wait_type, u32 wait_reason, u32 processor_mode, u32 alertable, u64 *opt_timeout)=0
virtual rex::platform::WaitResult WaitHostSockets (std::span< const rex::platform::SocketWait > sockets, std::chrono::milliseconds timeout)=0

Detailed Description

Waits on host and guest objects for XAM. A wait on a guest thread throws ThreadStop when the thread must stop.

Member Function Documentation

◆ WaitGuestObject()

virtual X_STATUS rex::kernel::IObjectWaiter::WaitGuestObject ( X_HANDLE handle,
u32 wait_reason,
u32 processor_mode,
u32 alertable,
u64 * opt_timeout )
pure virtual

Waits on the object a guest handle names, succeeding at once for a type without a wait handle.

Parameters
handleThe handle, pseudo handles are translated.
alertableNonzero when a user APC ends the wait.
opt_timeoutThe timeout in 100 nanosecond ticks, null to wait forever.
Returns
X_STATUS_SUCCESS, X_STATUS_USER_APC, X_STATUS_TIMEOUT, X_STATUS_ABANDONED_WAIT_0, or X_STATUS_INVALID_HANDLE.

◆ WaitGuestObjects()

virtual X_STATUS rex::kernel::IObjectWaiter::WaitGuestObjects ( std::span< const X_HANDLE > handles,
u32 wait_type,
u32 wait_reason,
u32 processor_mode,
u32 alertable,
u64 * opt_timeout )
pure virtual

Waits on the objects several guest handles name, as NtWaitForMultipleObjectsEx does. Delivers the pending user APCs when an alertable wait ends with X_STATUS_USER_APC.

Parameters
handlesThe handles, pseudo handles are translated.
wait_type0 to wait for any object, 1 to wait for all of them.
alertableNonzero when a user APC ends the wait.
opt_timeoutThe timeout in 100 nanosecond ticks, null to wait forever.
Returns
The status of the wait, or X_STATUS_INVALID_PARAMETER when a handle names no object.

◆ WaitHostObject()

virtual rex::platform::WaitResult rex::kernel::IObjectWaiter::WaitHostObject ( rex::platform::WaitHandle * handle,
std::chrono::milliseconds timeout )
pure virtual

On a guest thread a stop request throws ThreadStop, and any other wake resumes the wait for the time left.

Parameters
timeoutThe longest wait, milliseconds::max() for no limit.

◆ WaitHostSockets()

virtual rex::platform::WaitResult rex::kernel::IObjectWaiter::WaitHostSockets ( std::span< const rex::platform::SocketWait > sockets,
std::chrono::milliseconds timeout )
pure virtual

Waits until a socket may be ready, with the stop behavior of WaitHostObject.

Parameters
timeoutThe longest wait, milliseconds::max() for no limit.
Returns
kSuccess when a socket may be ready, kTimeout or kFailed.

The documentation for this class was generated from the following file: