[Mono-dev] Control-C handler

Jonathan Pryor jonpryor at vt.edu
Thu Jan 24 15:38:48 EST 2008

On Fri, 2008-01-11 at 14:57 -0500, Jonathan Pryor wrote:
> What exactly would be a "sane interface to ignore a signal" aside from
> e.g. Stdlib.signal(Signum.SIGINT, Stdlib.SIG_IGN) (and/or setting the
> default or error handler for the specified signal)?

After talking on IRC, the sane interface is to provide
Stdlib.signal_default(), Stdlib.signal_error(), and
Stdlib.signal_ignore() methods instead of using Stdlib.signal() with
SIG_DFL, SIG_ERR, and SIG_DFL.  This is safer, as we can just entirely
obsolete Stdlib.signal() now (which implies things that can't be safely
supported, like actual delegate support).

Other major changes include thread safety within the UnixSignal C
implementation, no dynamic memory allocation, and removal of the
"secondary thread for signal delivery" mechanism.

UnixSignal.WaitOne() still requires one pipe per invocation.

Patches attached, along with my test program.

 - Jon

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Mono.Posix-v3.diff
Type: text/x-patch
Size: 7550 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20080124/718bce68/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: support-v3.diff
Type: text/x-patch
Size: 5071 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20080124/718bce68/attachment-0001.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: us.cs
Type: text/x-csharp
Size: 681 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20080124/718bce68/attachment-0002.bin 

More information about the Mono-devel-list mailing list