in reply to how to kill a thread in windows
Be sure to get the latest version of the threads module from CPAN, and read the POD for more information and caveats.use threads; sub thr_func { # Thread 'cancellation' signal handler $SIG{'KILL'} = sub { threads->exit(); }; ... } # Create a thread my $thr = threads->create('thr_func'); ... # Signal the thread to terminate, and then detach # it so that it will get cleaned up automatically $thr->kill('KILL')->detach();
|
---|