Re: [racket] SIgnal-catching in Racket

2014-12-21 Thread Tony Garnock-Jones
Thanks Matthew and Robby! I'll give the self-pipe trick a try. Regards, Tony On 12/21/2014 09:01 AM, Matthew Flatt wrote: > You're right that can't post to a Racket semaphore in a signal handler. > > The way to allocate a global and make it available to Racket code is to > create a new kind of

Re: [racket] SIgnal-catching in Racket

2014-12-21 Thread Matthew Flatt
You're right that can't post to a Racket semaphore in a signal handler. The way to allocate a global and make it available to Racket code is to create a new kind of event; the 2006 post is still accurate. In particular, the new event's polling function (which is called by the scheduler) can check

Re: [racket] SIgnal-catching in Racket

2014-12-20 Thread Robby Findler
I don't know myself, but control-c raises an exception from an OS-level signal handler and so probably you'll have to make a similar bridge and that code might be worth looking at. Robby On Sat, Dec 20, 2014 at 1:05 PM, Tony Garnock-Jones wrote: > Hi all, > > If I wanted to catch a Unix signal