PxDelayRequest()
Request a delay job handle.
- APPLIES TO
-
8.2.0
- SYNOPSIS
-
PxDelay_t PxDelayRequest (PxOpool_t opoolid);
- ARGUMENTS
|
- RETURN VALUES
-
-
Valid delay job handle on success
-
Invalid delay job handle on failure
-
- ERROR CODES
-
PXERR_OPOOL_ILLOPOOL
opoolid
is not a valid object poolPXERR_ACCESS_RIGHT
The calling task has not the right to access the object pool
PXERR_OBJ_ABORTED
The request was aborted by an event
PXERR_EVENT_ZERO
The given event mask is zero
PXERR_OBJ_NOOBJ
No free object is available
PXERR_DELAY_ILLDELAY
Invalid delay object
PXERR_GLOBAL_ILLEGAL_CORE
The requested object pool is not on the same core
PXERR_OBJ_ILLOBJ
The passed object handle is not valid
PXERR_INTERNAL_INCONSISTENCY
Inconsistency of internal structures
- DESCRIPTION
-
The PxDelayRequest function creates a delay job object by converting a free object from object pool opool. The object handle is returned. If there is no free object available, the PxDelayRequest waits until a free object is available.
- IMPLEMENTATION GUIDELINES
-
- Before call
-
-
opoolid
must be a valid PXROS-HR object pool and the calling task must have the access right to take objects from this object pool (V). The validity ofopoolid
may also be checked by thePxOpoolIsValid
macro (F). The object pool must be created on the same core as the caller runs on. The creator core id can be read with the macroPxOpoolCoreId
and the own core id withPxGetCoreId
(C). Typically the task’s default object poolPXOpoolTaskdefault
is used for this purpose.
-
- After call
-
-
The returned value is the id of type
PxDelay_t
. This id may be checked with one of the following macros:-
PxDelayIdIsValid()
must be true. -
PxDelayIdGet()
must not be_PXIllegalObjId
. -
PxDelayIdError()
must bePXERR_NOERROR
otherwise the returned error code has to be interpreted (C).
-
-
- Best Practice
-
-
PxDelayRequest
may block, if no PXROS-HR object is available. If blocking calls are prohibited,PxDelayRequest_NoWait()
should be used instead. -
PxDelayRequest
should only be called during initialization to ensure the availability of the delay object.
-
- SEE ALSO
- USAGE
-
#include "pxdef.h" PxDelay_t Delay = PxDelayRequest(opoolid); if PxDelayIdError(Delay) != PXERR_NOERROR) { // Report error }