RTEMS Logo

RTEMS 4.9.3 On-Line Library


Semaphore Manager preq_sem - Poll and Request Semaphore

PREV UP NEXT Bookshelf RTEMS ITRON 3.0 API User's Guide

3.4.5: preq_sem - Poll and Request Semaphore

CALLING SEQUENCE:

ER preq_sem(
  ID semid
);

STATUS CODES:

E_OK - Normal Completion

E_ID - Invalid ID number (semid was invalid or could not be used)

E_NOEXS - Object does not exist (the semaphore specified by semid does not exist)

E_OACV - Object access violation (A semid less than -4 was specified from a user task. This is implementation dependent.)

E_TMOUT - Polling failure or timeout exceeded

E_CTX - Context error (issued from task-independent portions or a task in dispatch disabled state)

EN_OBJNO - An object number which could not be accessed on the target node is specified.

EN_PAR - A value outside the range supported by the target node and/or transmission packet format was specified as a parameter (a value outside supported range was specified for tmout)

DESCRIPTION:

This routine attempts to acquire the semaphore specified by semid. If the semaphore is available (i.e. positive semaphore count), then the semaphore count is decremented and the calling task returns immediately. Otherwise, the E_TMOUT error is returned to the calling task to indicate the semaphore is unavailable.

NOTES:

Multiprocessing is not supported. Thus none of the "EN_" status codes will be returned.

This routine will not cause the running task to be preempted.


PREV UP NEXT Bookshelf RTEMS ITRON 3.0 API User's Guide

Copyright © 1988-2008 OAR Corporation