in reply to Re: Waking threads that do periodic checks
in thread Waking threads that do periodic checks
What do you think is the point of this code?:
$thr->suspend(); $thr->yield();
Given that it is proceed by: $thr->join(); which means that the thread no longer exists by the time the above two lines are executed. In addition, the ->yield() method of the threads module isn't exported by default, and you do not import it.
Your code is exactly equivalent to:
#!/usr/bin/perl use strict; use warnings; $|=1; my $TERM = 0; $SIG{'INT'} = $SIG{'TERM'} = sub { $TERM = 1; }; print "To terminate program, hit ctrl-^C\n"; print( join(' ', ()) ); sleep (1) until ($TERM);
In other words it does exactly nothing useful and is in no way an answer to the OPs question.
|
|---|