[Previous] [Contents] [Next]

SyncMutexEvent(), SyncMutexEvent_r()

Attach an event to a mutex

Synopsis:

#include <sys/neutrino.h>

int SyncMutexEvent( sync_t * sync,
                    struct sigevent * event );

int SyncMutexEvent_r( sync_t * sync,
                      struct sigevent * event );

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 attach the specified event to a mutex pointed to by sync. When you're notified that a mutex has been put into the DEAD state because the memory that contained the mutex has been unmapped, you can revive the mutex with SyncMutexRevive().

Returns:

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

SyncMutexEvent()
If an error occurs, -1 is returned and errno is set. Any other value returned indicates success.
SyncMutexEvent_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:

EAGAIN
All kernel synchronization event objects are in use.
EFAULT
A fault occurred when the kernel tried to access sync.
EINVAL
The synchronization object pointed to by sync doesn't exist.

Classification:

QNX 6

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

See also:

SyncCondvarSignal(), SyncCondvarWait(), SyncDestroy(), SyncMutexLock(), SyncMutexRevive(), SyncMutexUnlock()


[Previous] [Contents] [Next]