Thread shared vars (19 answers)
Opened by Froschpopo at 2005-04-07 23:45

Froschpopo
 2005-04-08 00:50
#53563 #53563
User since
2003-08-15
2653 Artikel
BenutzerIn
[default_avatar]
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/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;
}

print "$var\n"; # sollte 1 ergeben

wie kann ich jetzt $var export,- bzw global importieren?\n\n

<!--EDIT|Froschpopo|1112907051-->

View full thread shared vars