Attach an event to a mutex
#include <sys/neutrino.h> int SyncMutexEvent( sync_t * sync, struct sigevent * event ); int SyncMutexEvent_r( sync_t * sync, struct sigevent * event );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
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.
If you call SyncMutexEvent() with a NULL event, the function deletes any existing event registration.
SyncMutexEvent() and SyncMutexEvent_r() are similar, except for the way they indicate errors. See the Returns section for details.
The only difference between these functions is the way they indicate errors:
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |
sigevent, SyncCondvarSignal(), SyncCondvarWait(), SyncDestroy(), SyncMutexLock(), SyncMutexRevive(), SyncMutexUnlock()