Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/syncsempost.html on line 1
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/syncsempost.html on line 1
Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/syncsempost.html on line 8
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/syncsempost.html on line 8
Increment a semaphore
#include <sys/neutrino.h>
int SyncSemPost( sync_t* sync );
int SyncSemPost_r( sync_t* sync );
- sync
- A pointer to the synchronization object for the semaphore that you want
to increment.
libc
Use the -l c option to
qcc
to link against this library.
This library is usually included automatically.
The SyncSemPost() and SyncSemPost_r()
kernel calls increment the semaphore referenced by
the sync argument.
If any threads are blocked on the semaphore, the one waiting the longest
is unblocked and allowed to run.
These functions are identical, except for the way they indicate errors.
See the Returns section for details.
|
You should use the POSIX
sem_post()
function instead of calling SyncSemPost() directly. |
The only difference between these functions is the way they indicate errors:
- SyncSemPost()
- If an error occurs, the function returns -1 and sets
errno.
Any other value returned
indicates success.
- SyncSemPost_r()
- Returns EOK on success.
This function does NOT set errno.
If an error occurs, the function returns one of the values listed in the
Errors section.
- 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.
QNX Neutrino
Safety: | |
Cancellation point |
No |
Interrupt handler |
No |
Signal handler |
Yes |
Thread |
Yes |
sem_destroy(),
sem_init(),
sem_post(),
sem_trywait(),
sem_wait(),
SyncDestroy(),
SyncSemWait(),
SyncTypeCreate()
Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/syncsempost.html on line 178
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/syncsempost.html on line 178