Look at the man page for sem_unlink. All it does is break the association between the name and the semaphore itself. If the semaphore is still open then it is still accessible and the semaphore will be destroyed after the last process closes it.
The only thing sem_unlink actually does is prevent any other process from opening the named semaphore after sem_unlink is called because the name association is broken. It does not have anything to do with destroying the semaphore and is not necessary to call prior to the last close because that close will unlink the name as well as destroy the semaphore. David Ashley On Fri, 2012-10-26 at 17:48 +0200, Manfred Lotz wrote: > On Fri, 26 Oct 2012 10:03:52 -0500 > David Ashley <[email protected]> wrote: > > > As long as the creator closes the semaphore everything will be ok - > > the semaphore will be unlinked and removed from the system. The > > creating process is the owner of the semaphore as far as removing it > > from the system. > > > > The sem_close man page states: > > sem_close() closes the named semaphore referred to by sem, > allowing any resources that the system has allocated to the calling > process for this semaphore to be freed. > > sem_unlink man page has: > sem_unlink() removes the named semaphore referred to by name. > The semaphore name is removed immediately. The semaphore is > destroyed once all other processes that have the semaphore open > close it. > > That is why I think sem_close does not eventually delete the sempahore > but it should be possible to trigger sem_unlink. > > > > In reality I believe that the rxapi process actually owns the > > semaphore and when the process ends it should attempt to remove all > > open files/pipes/semaphores/etc. Rick should be able to confirm this. > > > > I don't know. Let's see what Rick says. > > ------------------------------------------------------------------------------ The Windows 8 Center In partnership with Sourceforge Your idea - your app - 30 days. Get started! http://windows8center.sourceforge.net/ what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/ _______________________________________________ Oorexx-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/oorexx-devel
