in reply to Re: about THREAD SIGNALLING
in thread about THREAD SIGNALLING
still works.threads->kill('TERM');
Then I made a little more change to you code as:
#/usr/bin/perl use strict; use warnings; use threads; use threads::shared; $SIG{INT} = \&catchCtrlC; my @thrList; my $count = 1; share $count; my $counter = 3; while($counter) { $counter--; my $thrHandle = threads->create(\&thrdfun); push @thrList, $thrHandle; } foreach(@thrList){ $_->join(); } sub catch_CtrlC { foreach(@thrList){ $_->kill('TERM'); } } sub thrdfun { print "thrdfun: $count \n"; $count++; while(1){ (); } exit; }
It doesn't work. Could you tell me why?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: about THREAD SIGNALLING
by Khen1950fx (Canon) on Apr 23, 2013 at 08:26 UTC | |
by anaconda_wly (Scribe) on Apr 23, 2013 at 08:44 UTC | |
|
Re^3: about THREAD SIGNALLING
by anaconda_wly (Scribe) on Apr 23, 2013 at 07:15 UTC |