in reply to "Thread already joined at..." and "A thread exited while x threads were running" errors
You can trap fatal errors with eval. perldoc -f evalC:\>perl -Mthreads -e "my $t = threads->new( sub {} ); $t->join; $t->j +oin;die 2" Thread already joined at -e line 1.
C:\>perl -Mthreads -e "my $t = threads->new( sub {} ); $t->join; eval{ +$t->join};warn $@;die 2" Thread already joined at -e line 1. 2 at -e line 1.
thread exited while x threads were runningThat is a warning (not-fatal), not an error, and you can largely ignore it.
perldoc perldiag
perldoc diagnostics
update:
Also, $Config{useithreads} or die("Recompile Perl with threads to run this program.");
is useless as use threads; will fail if useithreads isn't defined.
|
|---|