Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - SyncMutexEvent: (5 Items)
   
SyncMutexEvent  
Hi,

SyncMutexEvent() call can be used to attach an event to a mutex to track it going into DEAD state. But is there a way to
 detach from that?
For example, my program can be doing several different functions (to be more correct, it may be doing several variants 
of the same functionality) and switch between them on the fly as configuration changes. At some time it may change to no
 need of watching for that mutex any more even though it will still exist in shared memory for other instances of 
program. How do I detach so that kernel did not attempt to deliver that event to my program?
Re: SyncMutexEvent  
> SyncMutexEvent() call can be used to attach an event to a mutex to track it 
> going into DEAD state. But is there a way to detach from that?
> For example, my program can be doing several different functions (to be more 
> correct, it may be doing several variants of the same functionality) and 
> switch between them on the fly as configuration changes. At some time it may 
> change to no need of watching for that mutex any more even though it will 
> still exist in shared memory for other instances of program. How do I detach 
> so that kernel did not attempt to deliver that event to my program?


What if I unmap the memory of the mutex (the mutex is locked by a different process at that time)? Will it cancel mutex-
event assignment?
Re: SyncMutexEvent  
Hi Oleh,

If you call SyncMutexEvent() with a null event then it will delete the existing event registration.

Oleh Derevenko wrote:
> Hi,
> 
> SyncMutexEvent() call can be used to attach an event to a mutex to track it going into DEAD state. But is there a way 
to detach from that?
> For example, my program can be doing several different functions (to be more correct, it may be doing several variants
 of the same functionality) and switch between them on the fly as configuration changes. At some time it may change to 
no need of watching for that mutex any more even though it will still exist in shared memory for other instances of 
program. How do I detach so that kernel did not attempt to deliver that event to my program?
> 
> _______________________________________________
> OSTech
> http://community.qnx.com/sf/go/post32924
> 

-- 
cburgess@qnx.com
Re: SyncMutexEvent  
Thanks for the answer, Colin. I guess, this definitely needs to be documentd. ;)

> If you call SyncMutexEvent() with a null event then it will delete the 
> existing event registration.
RE: SyncMutexEvent  
I agree. I'll create a PR.


Steve Reid (stever@qnx.com)
Technical Editor
QNX Software Systems 
 

> -----Original Message-----
> From: Oleh Derevenko [mailto:community-noreply@qnx.com] 
> Sent: Thursday, July 02, 2009 5:26 PM
> To: ostech-core_os
> Subject: Re: SyncMutexEvent
> 
> Thanks for the answer, Colin. I guess, this definitely needs 
> to be documentd. ;)
> 
> > If you call SyncMutexEvent() with a null event then it will 
> delete the 
> > existing event registration.
> 
> 
> _______________________________________________
> OSTech
> http://community.qnx.com/sf/go/post32999
> 
>