9 print "thread $num starting\n";
10 for ($i = 1; $i <= 20; $i++) {
11 print "thread $num iteration $i\n";
12 select(undef, undef, undef, rand(10)/100);
15 warn "thread $num saw non-zero level = $level\n" if $level;
17 print "thread $num has lock\n";
18 select(undef, undef, undef, rand(10)/100);
21 print "thread $num released lock\n";
25 for ($t = 1; $t <= 5; $t++) {
26 new Thread \&worker, $t;