1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/perl
use warnings;
use strict;
use threads;
use threads::shared;
my $var : shared = 0;
my $th_inc = threads->new( \&kind );
sub kind {
$var++;
return 0;
}
while(!$var) {
print "var: $var\n";
}
print "var: $var\n";
\n\n
<!--EDIT|esskar|1112907978-->