OSProcess: making sure that a child process always dies

David T. Lewis lewis at mail.msen.com
Mon Mar 19 21:13:09 UTC 2007


On Mon, Mar 19, 2007 at 08:53:54PM +0100, Damien Pollet wrote:
> On 19/03/07, David T. Lewis <lewis at mail.msen.com> wrote:
> >The expression "OSProcess accessor forwardSigUsr1" answers a semaphore
> >the should be signaled each time the VM receives a SIGUSR1 from the
> >operating system. If you create the semaphore once, then wait on
> >in it a loop, I think it will do what you want.
> 
> Yes, I put the semaphore in a temporary variable then use it inside
> the loop, and it works.
> 
> But why does the method answer nil after it was used once?
> If the semaphore is a singleton, shouldn't forwardSigUsr1 always
> return the same object?

I don't have the code in front of me, but I think I set it up so
there would be at most one semaphore associated with a signal type,
and that semaphore is registered in the external objects array.
Thus you can create the semaphore one time, but if you try to
create it again nothing will happen. I guess a warning would have
been better than just answering nil. By the way, you should be
able to unregister the signal forwarder, then the next time you
try register it, it would succeed again (once).

Dave




More information about the Squeak-dev mailing list