Re: [NSTask] -launch return
Re: [NSTask] -launch return
- Subject: Re: [NSTask] -launch return
- From: Michael Ash <email@hidden>
- Date: Wed, 10 Jun 2009 02:59:16 -0400
On Tue, Jun 9, 2009 at 11:12 PM, Erg Consultant<email@hidden> wrote:
> I later monitor the pid that I squirreled away from within a periodic timer:
>
> err = GetProcessForPID( pid, &psn );
>
> If GetProcessForPID returns an error, I know the process is not running.
No you don't.
If GetProcessForPID returns an error, you know the process is not
running OR has not checked in with the window server yet.
A process can take an arbitrary amount of time to check in with the
window server. If this is your problem with Rosetta, then it's simply
exposing a bug in your code. You need to fix it to handle the case
where GetProcessForPID returns an error for a process that is alive.
This can and will happen. If you want to see if the process is
running, check for its existence directly (like with [task isRunning])
not by seeing if it has a PSN. Many processes do not have PSNs,
including every process you launch with NSTask until they check in
with the window server, if they ever do.
Mike
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden