7 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use strict;
use threads;
my $th_inc = threads->new( \&kind );
sub kind {
my $var = 0;
while(1) {
$var++;
fertig($var);
last if $var == 10;
}
return 0;
}
sub fertig {
# hier steht nichts drin
}
1
2
3
4
5
Can't undef active subroutine
(F) You can't undefine a routine that's currently run-
ning. You can, however, redefine it while it's run-
ning, and you can even undef the redefined subroutine
while the old routine is running. Go figure.
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/perl
use strict;
use threads;
use Tk;
my $th_inc = threads->new( \&kind );
sub kind {
#
}
$th_inc->join();
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/perl
use strict;
use threads;
my $th_inc = threads->new( \&kind );
$th_inc->join();
sub kind {
sleep(4);
print "Kind ist fertig\n";
exit;
}
print "Vater fertig\n";
1
2
3
4
5
6
7
8
9
10
use warnings;
use strict;
use threads;
my $th_inc = threads->new( \&kind );
sub kind {
print "hi";
exit;
}
7 Einträge, 1 Seite |