[Haskell-cafe] how to catch keyboard interrupts?
Uwe Hollerbach
uhollerbach at gmail.com
Sat Feb 23 18:31:11 EST 2008
Thanks, Bulat, I'll look into this!
On 2/23/08, Bulat Ziganshin <bulat.ziganshin at gmail.com> wrote:
> Hello Uwe,
>
>
> Saturday, February 23, 2008, 11:35:35 PM, you wrote:
>
> >> mysighandler =
> >> Catch (do hPutStrLn stderr "caught a signal!"
> >> fail "Interrupt!")
>
>
> > scheme calculation doesn't get interrupted at all! I see in the
> > System.Posix.Signals documentation that the signal handler gets
> > invoked in a new thread; is this the source of the problem?
>
>
> yes, fail kills only this thread :)
>
> you should store thread id of thread running interpreter and send
> async exception to it. control.concurrent is probably contains all
> required functions
>
>
>
> --
> Best regards,
> Bulat mailto:Bulat.Ziganshin at gmail.com
>
>
More information about the Haskell-Cafe
mailing list