Jerry D. Hedden wrote:
> When a thread dies, it issues a warning.  It the thread's warning
> handler subsequently issues an 'exit()', that exit will operate as
> per the above.

Jan Dubois wrote: 
> This doesn't feel quite right.  If exit() terminates the application,
> then die() should produce an error and exit the application and not
> just produce a warning.

There seems to be some confusion here.  Here's an example of the
behavior I'm talking about.

sub thr_func
{
    $SIG{__WARN__} = sub {
        print("I hate warnings: $_[0]");
        exit(1);
    };

    die("Thread dies for some reason\n");
}

threads->create('thr_func');
sleep(99);

In the above, the thread 'die's which results in a warning.  (In and
of itself, this would not terminate the application.)  The warning
is then intercepted by the thread's warning handler which subsequently
executes an 'exit'.  This results in the whole application terminating.

Reply via email to