PxOpoolRelease()

Release an object pool object.

APPLIES TO

8.2.0

SYNOPSIS
PxOpool_t PxOpoolRelease (PxOpool_t Opool);
ARGUMENTS
Opool

Object pool object to be released

RETURN VALUES
  • Invalid object pool handle on success

  • Object pool on failure

ERROR CODES

PXERR_OPOOL_ILLOPOOL

Opool is not a valid pool object

PXERR_OPOOL_TASKWAITS

A task is waiting at the object pool

PXERR_OPOOL_ILLDELETE

Tried to delete a real object pool with no source

PXERR_GLOBAL_ILLEGAL_CORE

The requested object pool is not on the same core

PXERR_TASK_ILLTASK

The task is not a valid task object

PXERR_INTERNAL_INCONSISTENCY

Inconsistency of internal structures

DESCRIPTION

PxOpoolRelease releases the object pool handle Opool by converting it into a generic object and releasing this object.

IMPLEMENTATION GUIDELINES
Before call
  • Opool must be a valid PXROS-HR object pool created with a PxOpoolRequest call (V). The validity of Opool may also be checked by the PxOpoolIsValid macro (F).

After call
  • PxOpoolRelease returns the object pool to the object pool it has been taken from. On success PxOpoolRelease returns the invalidated object pool. This may be checked with one of the following macros:

    • PxOpoolIdIsValid() must be false.

    • PxOpoolIdGet() must be _PXIllegalObjId.

    • PxOpoolIdError() must be PXERR_NOERROR otherwise the returned error code has to be interpreted (C).

Best Practice
  • After PxOpoolRelease, the given object pool Opool is no longer valid and may never be used as object pool!

SEE ALSO
USAGE
#include "pxdef.h"

PxOpool_t Opool = PxOpoolRelease(Opool);

if (PxOpoolIdError(Opool) == PXERR_NOERROR) {
    // Report error
}