0
sub handle_sigterm {
my @running = threads->list(threads::running);
for my $thr (@running) {
$thr->kill('SIGTERM')->join();
}
threads->exit;
} ## end sub handle_sigterm
OUTPUT:
Perl exited with active threads:
1 running and unjoined
0 finished and unjoined
1 running and detached
看起来像handle_sigterm退出时没有清理线程?Perl:退出前清理活动线程
我能做些什么清理线程?