Posted on 2009-02-27 20:56:07-08 by jdhedden in response to 10078
Re: CGI with threads throws error
Try joining the threads after you 'kill' them instead of detaching:
local $SIG{'KILL'} = sub { threads->exit(); }; .... sub kill_loose_threads { # Send signals first foreach my $thread (threads->list()) { $thread->kill('KILL'); } # Join up with the terminating threads foreach my $thread (threads->list()) { $thread->join(); } }
Also, add an explicit 'exit(0);' after the 'main();' call at the bottom of the script.
Direct Responses: 10100 | Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.