[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [plt-scheme] mred control-c



At Thu, 6 Jun 2002 05:44:29 -0700 (PDT), Ron Stanonik wrote:
> Control-c (linux plt 200) causes mzscheme to break out of what's currently
> being executed and return to the mzscheme user prompt.
> 
> Control-c causes mred to exit.
> 
> How can we make mred -z behave like mzscheme?
> 
> I copied the mzscheme SIGINT handling code into an extension and
> loaded that into mred.  mred reports "user break" when control-c
> is hit, but still exits.

It doesn't work because the MzScheme code sends a break to the main
MzScheme thread, but MrEd uses the main MzScheme thread to prepare
events for dispatching. The main user thread in MrEd is not really the
underlying main MzScheme thread.

In other words, the break signal isn't going to the thread that you
wanted.

I've added a signal handler for 200alpha21 that directs the break to
the main user thread.

If you want to patch your code, the main user thread is created by the
sole call to scheme_thread() in mred.cxx. The returned thread pointer
should be used in place of NULL in the signal handler's call to
scheme_break_thread().

Matthew