Can I circumvent nothrow?

Brad Roberts via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Apr 26 18:57:20 PDT 2014


On 4/26/14, 6:39 PM, Damian Day via Digitalmars-d-learn wrote:
> So I have this procedure:
> extern (C) void signal_proc(int sn) @system nothrow
> Which can call this:
> shutdown_system() @system nothrow
>
> Problem I have is inside "shutdown_system()" I have code that can't
> possibly be @nothrow because their are a lot of subsystems to shutdown.
>
> What I've done for now is just strip the @nothrow attribute of the C function in
> core.stdc.signal. It feels very hackish but it works..

Careful here.. it sounds like you're doing work inside a signal handler that's likely to be unsafe / 
undefined.  There's very very little that you can safely do inside a signal handler.  Hit google and 
search for async signal safe.


More information about the Digitalmars-d-learn mailing list