[Previous] [Contents] [Next]

SyncMutexRevive(), SyncMutexRevive_r()

Revive a mutex

Synopsis:

#include <sys/neutrino.h>

int SyncMutexRevive( sync_t * sync );

int SyncMutexRevive_r( sync_t * sync );

Library:

libc

Description:

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

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

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

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 6

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

See also:

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


[Previous] [Contents] [Next]