use warnings; use strict; use threads; use threads::shared; use Data::Dumper; sub test { my %h : shared; for (1 .. 3) { threads->create(sub { my $n = shift; lock %h; $h{$n} = rand; }, $_)->join; } return %h; } print Dumper {test()};
In reply to Re: bug in threads::shared or is it just me?
by choroba
in thread bug in threads::shared or is it just me?
by dada
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |