[darcs-users] ctrl-c, windows

David Roundy droundy at abridgegame.org
Mon Aug 16 10:01:33 UTC 2004


On Mon, Aug 16, 2004 at 10:27:25AM +0200, Peter Strand wrote:
> Martin Schaffner wrote:
> >>Sun Aug 15 13:43:45 CEST 2004  David Roundy <droundy at abridgegame.org>
> >> * update version number to 1.0.0rc1.
> >
> >IMO, before going 1.0.0, darcs needs to delete _darcs/lock after a
> >ctrl-c on Windows.

At this stage, I'm not going to hold up 1.0.0 for this, since I can't do it
myself.  However, patches to fix this would be most welcome.

> I was looking into this a while ago, but got stuck on how to do it in
> other consoles than the normal "cmd.exe" one.
> Especially mingw's rxvt doesn't behave as a normal console in windows,
> it has problems with unbuffered input as well, IIRC.
> 
> However, I think I've seen programs which works correctly there, so it's 
> obviously possible.
> 
> But I almost never use the standard console in windows, it's always 
> either cygwin or mingw, so a solution that doesn't support these 
> wouldn't be very useful (to me at least).
> 
> A small quirk with the ctrl-c handling in win32 is that the callback is 
> called in a new thread in the process, so darcs needs to be compiled 
> with the threaded rts to avoid crashing. But it's not much of a problem 
> as recent versions of ghc makes the threaded rts available via a 
> compilation flag (not recompilation of ghc as it used to be).

I guess this would mean we'd perhaps need a global flag, a callback
function that sets the global flag, and a haskell thread that polls the
global flag and when it finds it set throws an exception to the main
thread? On the plus side, with such a nasty solution it should be easy to
add support for different methods of signal handling (mingw or whatever),
since it could all be done in pure C, just setting that one global
"interrupt signal" flag.
-- 
David Roundy
http://www.abridgegame.org




More information about the darcs-users mailing list