X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=ext%2FThread%2Fio.t;h=6012008ef5743dc5312744dee157dd10c23e361b;hb=146174a91a192983720a158796dc066226ad0e55;hp=8ade26504de09f98eaeb16eb56d2d1e88b330efc;hpb=c1f329308b702519079b58d1f4c523ce60dc9990;p=p5sagit%2Fp5-mst-13.2.git diff --git a/ext/Thread/io.t b/ext/Thread/io.t index 8ade265..6012008 100644 --- a/ext/Thread/io.t +++ b/ext/Thread/io.t @@ -1,5 +1,13 @@ use Thread; +sub counter { +$count = 10; +while ($count--) { + sleep 1; + print "ping $count\n"; +} +} + sub reader { my $line; while ($line = ) { @@ -17,7 +25,13 @@ finished counting down and the I/O thread has seen end-of-file on the terminal/stdin. EOT -$r = new Thread \&reader; +$r = new Thread \&counter; + +&reader; + +__END__ + + $count = 10; while ($count--) { sleep 1;