MPWaitTaskQWithTimeout

Syntax

#include <cafe/mp.h>

BOOL MPWaitTaskQWithTimeout(MPTaskQ *taskq, u32 wmask, OSTimeNanoseconds timeout);

Parameters

taskq MPTaskQ to wait on.
wmask The mask that is used to wait on items entering the MPTaskQ. Items matching the mask that are available in the MPTaskQ cause this function to exit.

(1 << 0) MP_TASKQ_INIT
(1 << 1) MP_TASKQ_RUN
(1 << 2) MP_TASKQ_STOPPING
(1 << 3) MP_TASKQ_STOP
(1 << 4) MP_TASKQ_DONE

The following multiple or state masks are usable.
MP_WAIT_TASKQ_RUN | MP_WAIT_TASKQ_DONE
MP_WAIT_TASKQ_STOP | MP_WAIT_TASKQ_DONE
timeout Minimum number of nanoseconds to wait before returning FALSE.

Adhering to an exact number of nanoseconds is not guaranteed. This function only has a time-inspection granularity roughly equivalent to the processor timebase.

Return Values

TRUE: The specified MPTaskQ has MPTasks available based on the waitmask.
FALSE: The specified MPTaskQ has no MPTasks available based on the waitmask or has timed out waiting.

Description

MPWaitTaskQWithTimeout waits on the specified MPTaskQ to contain MPTasks to run. The MPTasks can be added by any processor core that calls MPEnqueTask.

Do Not Call From

Multiple threads This function is not thread-safe.
Callbacks Do not call this function from any callback function.

See Also

MPDequeTask
MPDequeTasks
MPEnqueTask
MPGetTaskQInfo
MPInitTaskQ
MPResetTaskQ
MPRunTasksFromTaskQ
MPStartTaskQ
MPStopTaskQ
MPTermTaskQ
MPWaitTaskQ

Revision History

2013-05-08 Automated cleanup pass.
2012-08-21 Cleanup Pass
2012-05-14 Fixed See Also.
2012-05-04 Matched the actual prototype.
2010-08-23 Initial version.


CONFIDENTIAL