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

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 );

Arguments:

sync
A pointer to the synchronization object for the mutex that you want to attach an event to.
event
A pointer to the sigevent structure that describes the event that you want to attach.

Library:

libc

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

Description:

The SyncMutexEvent() is a kernel call that attaches a specified event to a mutex pointed to by sync. You use SyncMutexRevive() to revive a DEAD mutex. Normally, a mutex will be placed in the DEAD state when the memory that was used to lock the mutex gets unmapped. One of the ways this may happen is when a process dies while holding the mutex in a shared memory.

SyncMutexEvent() and SyncMutexEvent_r() are similar, except for the way they indicate errors. See the Returns section for details.

Returns:

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

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

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 Neutrino

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

See also:

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


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/syncmutexevent.html on line 178

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/syncmutexevent.html on line 178