Re: What if process crashes while holding a locked semaphore?
Re: What if process crashes while holding a locked semaphore?
- Subject: Re: What if process crashes while holding a locked semaphore?
- From: Chris Suter <email@hidden>
- Date: Tue, 31 Mar 2009 18:02:48 +1100
Hi Jerrry,
On Tue, Mar 31, 2009 at 5:51 PM, Chris Suter <email@hidden> wrote:
> Have you considered using Mach ports for what you're trying to do?
>
> I forget all the details but I'm pretty sure you could do what you
> want with Mach ports without any great difficulty.
I just had a quick look and something like this would probably do the trick:
if (![[NSPortNameServer systemDefaultPortNameServer] registerPort:
[NSPort port] name:@"com.mycompany.myproduct.runonce"]]) {
// An instance is already running...do something
}
Kind regards,
Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden