RTEMS Logo

RTEMS 4.7.99.2 On-Line Library


Semaphore Manager sem_post - Unlock a Semaphore

PREV UP NEXT Bookshelf RTEMS POSIX API User's Guide

9.4.9: sem_post - Unlock a Semaphore

CALLING SEQUENCE:

int sem_post(
  sem_t *sem
);

STATUS CODES:

EINVAL
The sem argument does not refer to a valid semaphore

DESCRIPTION:

This function attempts to release the semaphore specified by sem. If other tasks are waiting on the semaphore, then one of those tasks (which one depends on the scheduler being used) is allowed to lock the semaphore and return from its sem_wait(), sem_trywait(), or sem_timedwait() call. If there are no other tasks waiting on the semaphore, then the semaphore value is simply incremented. sem_post() returns 0 upon successful completion.

If an error occurs, the function returns -1 and sets errno to the appropriate error code.

NOTES:

Multiprocessing is not supported in this implementation.


PREV UP NEXT Bookshelf RTEMS POSIX API User's Guide

Copyright © 1988-2004 OAR Corporation