severe bugs in change#3786 fixed
[p5sagit/p5-mst-13.2.git] / ext / Thread / specific.t
CommitLineData
458fb581 1use Thread;
2
3use Thread::Specific qw(foo);
4
5sub count {
6 my $tid = Thread->self->tid;
7 my Thread::Specific $tsd = Thread::Specific::data;
8 for (my $i = 0; $i < 5; $i++) {
9 $tsd->{foo} = $i;
10 print "thread $tid count: $tsd->{foo}\n";
11 select(undef, undef, undef, rand(2));
12 }
13};
14
15for(my $t = 0; $t < 5; $t++) {
16 new Thread \&count;
17}