[erlang-questions] Exit signals are funny things
Wed May 3 18:05:40 CEST 2017
Well its a very deliberate decision by someone.
BIF_P == rp ? ERTS_XSIG_FLG_NO_IGN_NORMAL : 0);
It sends ERTS_XSIG_FLG_NO_IGN_NORMAL if you are sending a signal to yourself.
On Wed, May 3, 2017 at 2:03 PM, Robert Virding <> wrote:
> 1> Pid = spawn_link(fun() -> timer:sleep(infinity) end).
> 2> exit(Pid, normal).
> 3> flush().
> 4> exit(Pid, die).
> ** exception exit: die
> I spawn_link a process which is not trapping and send it the signal 'normal'
> which it ignores. As it should. I then send it the signal 'die' and it
> crashes. As it should.
> 5> exit(self(), normal).
> ** exception exit: normal
> Now I send myself the signal 'normal' and I die! So there is 'normal' and
> there is 'normal' depending on to whom I send it.
> Where's the logic in that?
> P.S. More to come
> erlang-questions mailing list
More information about the erlang-questions