On Tue, Jan 09, 2001 at 05:15:35PM +0000, Nick Ing-Simmons wrote: > Alan Burlison <Alan.Burlison@uk.sun.com> writes: > >Nick Ing-Simmons wrote: > > > >> Apparently not. I cannot at present think what sigsetjmp() gains > >> us. Do you have an guidelines which say "use sigsetjmp() if your code does X?" > > > >In perl terms, I think the only time this would happen is if you did a > >die inside a signal handler, and expected to go back to an enclosing > >eval() with the signal handler restored. > > I am sure we could do something special round perl signal handlers > and leave the vast bulk of other eval {} / G_EVAL code using > normal setjmp(). > > Unless there is a more obvious/portable mechanism to save/restore the > mask then something like: > > void > invoke_handler(...) > { > code = sigsetjmp(...); > if (!code) > { > perl_call_xxx(...,G_EVAL|G_VOID); > if (SvTRUE(PL_errsv)) > siglongjmp(...,1); > } > } > > should do it. I like that approach. I'd be nervous of just switching from the sig functions to non-sig globally. Tim.Thread Previous | Thread Next