How to abort with a longjmp?

View: New views
2 Messages — Rating Filter:   Alert me  

How to abort with a longjmp?

by Günter Kniesel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

the SWI manual says that abort_with_exception is changeable:

     abort_with_exception (bool, changeable)
          Determines how  abort/0 is realised. See the description of
          abort/0 for details.

However, the interpreter disagrees:

?- set_prolog_flag(abort_with_exception, false).
ERROR: [Thread pdt_console_client_0@localhost] set_prolog_flag/2: No permission to modify flag `abort_with_exception'

Is there anything that I can to to enforce the alternative abort behaviour
that uses the longjmp to rebuild the environment?

Günter
_______________________________________________
SWI-Prolog mailing list
SWI-Prolog@...
https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog

Re: How to abort with a longjmp?

by Jan Wielemaker-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 2009-10-06 at 20:20 +0200, Günter Kniesel wrote:

> Hi,
>
> the SWI manual says that abort_with_exception is changeable:
>
>      abort_with_exception (bool, changeable)
>           Determines how  abort/0 is realised. See the description of
>           abort/0 for details.
>
> However, the interpreter disagrees:
>
> ?- set_prolog_flag(abort_with_exception, false).
> ERROR: [Thread pdt_console_client_0@localhost] set_prolog_flag/2: No permission to modify flag `abort_with_exception'
>
> Is there anything that I can to to enforce the alternative abort behaviour
> that uses the longjmp to rebuild the environment?

Not really.  longjmp is simply too dangerous.  Development that is going
on right now is probably going to remove longjmp from the entire system.
This is particularly the case when using threads ...  Anyway, this
should not be needed.  What is the problem?

    --- Jan

_______________________________________________
SWI-Prolog mailing list
SWI-Prolog@...
https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog