line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Thread::Stack; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
29476
|
use 5.008; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
76
|
|
4
|
1
|
|
|
1
|
|
2389
|
use threads::shared; |
|
1
|
|
|
|
|
1639
|
|
|
1
|
|
|
|
|
8
|
|
5
|
1
|
|
|
1
|
|
82
|
use strict; |
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
30
|
|
6
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
49
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '1.00'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
13
|
1
|
|
|
1
|
1
|
10
|
my $class = shift; |
14
|
1
|
|
|
1
|
|
1067
|
my @q : shared = @_; |
|
1
|
|
|
|
|
1709
|
|
|
1
|
|
|
|
|
232
|
|
|
1
|
|
|
|
|
8
|
|
15
|
1
|
|
|
|
|
34
|
return bless \@q, $class; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub pop { |
19
|
1
|
|
|
1
|
1
|
1
|
my $q = shift; |
20
|
1
|
|
|
|
|
2
|
lock(@$q); |
21
|
1
|
|
|
|
|
4
|
cond_wait @$q until @$q; |
22
|
1
|
50
|
|
|
|
22
|
cond_signal @$q if @$q > 1; |
23
|
1
|
|
|
|
|
3
|
return CORE::pop @$q; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub pop_nb { |
27
|
0
|
|
|
0
|
1
|
0
|
my $q = shift; |
28
|
0
|
|
|
|
|
0
|
lock(@$q); |
29
|
0
|
|
|
|
|
0
|
return CORE::pop @$q; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
sub push { |
32
|
2
|
|
|
2
|
1
|
349
|
my $q = shift; |
33
|
2
|
|
|
|
|
5
|
lock(@$q); |
34
|
2
|
50
|
|
|
|
54
|
push @$q, @_ and cond_signal @$q; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub size { |
38
|
2
|
|
|
2
|
1
|
227
|
my $q = shift; |
39
|
2
|
|
|
|
|
5
|
lock(@$q); |
40
|
2
|
|
|
|
|
7
|
return scalar(@$q); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
__END__ |