[Previous] [Contents] [Next]

SyncSemPost(), SyncSemPost_r()

Increment a semaphore

Synopsis:

#include <sys/neutrino.h>

int SyncSemPost( sync_t* sync );

int SyncSemPost_r( sync_t* sync );

Library:

libc

Description:

The SyncSemPost() and SyncSemPost_r() functions are identical except in the way they indicate errors. See the Returns section for details.

These functions increment the semaphore referenced by the sync argument. If any threads are blocked on the semaphore, the one waiting the longest is inblocked and allowed to run.

Returns:

The only difference between these functions is the way they indicate errors:

SyncSemPost()
If an error occurs, -1 is returned and errno is set. Any other value returned indicates success.
SyncSemPost_r()
EOK is returned on success. This function does NOT set errno. If an error occurs, any value in the Errors section may be returned.

Errors:

EAGAIN
Not enough memory for the kernel to create the internal sync object.
EFAULT
Invalid pointer.
EINTR
A signal interrupted this function.
EINVAL
The sync argument doesn't refer to a valid semaphore.

Classification:

QNX 6

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

SyncSemWait()


[Previous] [Contents] [Next]