[MLton] cvs commit: better blocking/unblocking of signals in runtime and basis

Stephen Weeks MLton@mlton.org
Thu, 15 Apr 2004 08:47:06 -0700


> > I guess it doesn't matter, but SIG_SETMASK might be clearer here.
> 
> No, because SIG_SETMASK installs exactly &s->signalsHandled, which may not
> include everything that is blocked. 

Ahh.  Thanks.

> > > +Int Posix_Signal_sigprocmask () {
> > > +	gcState.signalsBlocked = set;
> > > +	if (gcState.inSignalHandler)
> > > +		return 1;
> > > +	return sigprocmask (SIG_SETMASK, &set, (sigset_t*)NULL);
> >
> > I don't understand why 1 is returned if gcState.inSignalHandler.
> > sigprocmask is supposed to return 0 on success and -1 on error.  We
> > could try to figure out what it should mean to block/unblock signals
> > while running a handler -- until we figure this out, we could raise an
> > exception if someone tries to do so.
> 
> I meant for it to return success, so it should return 0.

OK.  I wonder if it would be clearer to skip the creation of the
sigset and the call to sigprocmask from the ML side?