[Previous] [Contents] [Next]

SyncDestroy(), SyncDestroy_r()

Destroy a synchronization object

Synopsis:

#include <sys/neutrino.h>

int SyncDestroy( sync_t* sync );

int SyncDestroy_r ( sync_t* sync );

Library:

libc

Description:

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

These 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.

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, -1 is returned and errno is set. Any other value returned indicates success.
SyncDestroy_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:

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 6

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

See also:

SyncTypeCreate()


[Previous] [Contents] [Next]