SyncMutexRevive(), SyncMutexRevive_r()

Revive a mutex that's in the DEAD state

Synopsis:

#include <sys/neutrino.h>

int SyncMutexRevive( sync_t * sync );

int SyncMutexRevive_r( sync_t * sync );

Arguments:

sync
A pointer to the synchronization object for the mutex that you want to revive.

Library:

libc

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

Description:

The SyncMutexRevive() and SyncMutexRevive_r() kernel calls revive a mutex, pointed to by sync, that's in the DEAD state. The mutex will be put into the LOCK state and will be owned by the calling thread. The mutex counter is set to one (for recursive mutexes).

These functions are similar, except for the way they indicate errors. See the Returns section for details.

See SyncMutexEvent() for information on how to get notified when a mutex enters the DEAD state.

Returns:

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

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

Errors:

EFAULT
A fault occurred when the kernel tried to access the buffers you provided.
EINVAL
The synchronization object pointed to by sync doesn't exist or wasn't in the DEAD state.
ETIMEDOUT
A kernel timeout unblocked the call. See TimerTimeout().

Classification:

QNX Neutrino

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

See also:

pthread_mutex_lock(), pthread_mutex_unlock(), SyncTypeCreate(), SyncDestroy(), SyncMutexEvent(), SyncMutexLock(), SyncMutexUnlock()