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_ILLOPOOLopoolidis not a valid object poolPXERR_ACCESS_RIGHTThe calling task has not the right to access the object pool
PXERR_OBJ_ABORTEDThe request was aborted by an event
PXERR_EVENT_ZEROThe given event mask is zero
PXERR_OBJ_NOOBJNo free object is available
PXERR_DELAY_ILLDELAYInvalid delay object
PXERR_GLOBAL_ILLEGAL_COREThe requested object pool is not on the same core
PXERR_OBJ_ILLOBJThe passed object handle is not valid
PXERR_INTERNAL_INCONSISTENCYInconsistency of internal structures
- DESCRIPTION
-
The
PxDelayRequestfunction creates a delay job object by converting a free object from object poolopool. The object handle is returned. If there is no free object available, thePxDelayRequestwaits until a free object is available.
- IMPLEMENTATION GUIDELINES
-
- Before call
-
-
opoolidmust 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 ofopoolidmay also be checked by thePxOpoolIsValidmacro (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 macroPxOpoolCoreIdand the own core id withPxGetCoreId(C). Typically the task’s default object poolPXOpoolTaskdefaultis 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_NOERRORotherwise the returned error code has to be interpreted (C).
-
-
- Best Practice
-
-
PxDelayRequestmay block, if no PXROS-HR object is available. If blocking calls are prohibited,PxDelayRequest_NoWait()should be used instead. -
PxDelayRequestshould 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 }