[MLton] interrupted system call

Matthew Fluet fluet@cs.cornell.edu
Sun, 28 Mar 2004 20:27:30 -0500 (EST)


> >     + the translation of atomicEnd can actually be predicated upon
> >       handlesSignals.  We are keeping the canHandle inc and dec because
> >       it's useful for asserts.  But, there is no need to put in a GC safe
> >       point if signals aren't being handled.
>
> I had forgotten that's the only reason we keep the inc and dec.  Maybe
> this would be a good time to fix that.  We could make them no-ops if
> the the program doesn't handle signals, keep a flag in gcState, and
> fix any asserts to be "not s->handlesSignals orelse ...".

I'd really like to add
      structure AtomicState :
	 sig
	    datatype t = NonAtomic | Atomic of int
	 end
      val atomicState: unit -> AtomicState.t
to MLton.Thread.  It's useful for asserts in ML.  The inc/dec of canHandle
is cheap.  We can drop the  if (signalIsPending)  part of the code in the
absence of handlesSignals.