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/syncdestroy.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/syncdestroy.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/syncdestroy.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/syncdestroy.html on line 8

SyncDestroy(), SyncDestroy_r()

Destroy a synchronization object

Synopsis:

#include <sys/neutrino.h>

int SyncDestroy( sync_t* sync );

int SyncDestroy_r ( sync_t* sync );

Arguments:

sync
The synchronization object that you want to destroy.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The SyncDestroy() and SyncDestroy_r() kernel calls destroy a synchronization object previously allocated by a call to SyncTypeCreate(). If the object is a locked mutex, or a condition variable with waiting threads, the call fails. Any attempt to use sync after it is destroyed fails.

These functions are identical except in the way they indicate errors. See the Returns section for details.


Note: Don't call SyncDestroy() directly; instead, use the POSIX synchronization objects (see pthread_cond_destroy(), pthread_mutex_destroy(), pthread_rwlock_destroy(), and sem_destroy()).

Blocking states

These calls don't block.

Returns:

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

SyncDestroy()
If an error occurs, the function returns -1 and sets errno. Any other value returned indicates success.
SyncDestroy_r()
Returns EOK on success. This function does NOT set errno. If an error occurs, the function can return any value listed in the Errors section.

Errors:

EBUSY
The synchronization object is locked by a thread.
EFAULT
A fault occurred when the kernel tried to access sync.
EINVAL
The synchronization ID specified in sync doesn't exist.

Classification:

QNX Neutrino

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

See also:

pthread_cond_destroy(), pthread_mutex_destroy(), pthread_rwlock_destroy(), sem_destroy(), 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/syncdestroy.html on line 193

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/syncdestroy.html on line 193