Re: How to get the name of an opened semaphore?
Re: How to get the name of an opened semaphore?
- Subject: Re: How to get the name of an opened semaphore?
- From: Peter Lovell <email@hidden>
- Date: Fri, 24 Jun 2005 07:22:23 -0400
On Jun 23, 2005, at 9:48 PM, Tron Thomas wrote:
It seems that to solve my problem with semaphores and device space,
that I should try unlinking the named semaphores when I close
them. Opening a semaphore provides a sem_t pointer that can be
used to close the semaphore. Unlinking a semaphore, however,
requires the name used when opening the semaphore.
How can I obtain the name of the semaphore without having to
maintain the relationship between the semaphore name and its
corresponding sem_t pointer myself?
You can of course unlink the semaphore before then, depending upon
the needs of your application. Once it is unlinked, no-one can open
it but the existing semaphore remains available until the last
reference is closed. In one instance I have, for example, the
semaphore is used between threads so the semaphore is unlinked
immediately after being opened. Your case may be different (I don't
have your original post here right now).
You might also look in darwin for the source to ipcs and ipcrm.
Obviously they can find the names, but it's possible that you'd need
root access. However, it might be that you could find the ones you
created.
Cheers.....Peter
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden