line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#line 1 |
2
|
1
|
|
|
1
|
|
17
|
package Test::SharedFork::Array; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
124
|
|
3
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
43
|
|
4
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
2490
|
|
5
|
1
|
|
|
1
|
|
4197
|
use base 'Tie::Array'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
1462
|
|
6
|
|
|
|
|
|
|
use Storable (); |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# create new tied array |
9
|
1
|
|
|
1
|
|
4
|
sub TIEARRAY { |
10
|
1
|
|
|
|
|
5
|
my ($class, $share) = @_; |
11
|
1
|
|
|
|
|
5
|
my $self = bless { share => $share }, $class; |
12
|
|
|
|
|
|
|
$self; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
15
|
|
|
15
|
|
19
|
sub _get { |
17
|
15
|
|
|
|
|
45
|
my $self = shift; |
18
|
|
|
|
|
|
|
return $self->{share}->get('array'); |
19
|
|
|
|
|
|
|
} |
20
|
14
|
|
|
14
|
|
26
|
sub FETCH { |
21
|
14
|
|
|
|
|
28
|
my ($self, $index) = @_; |
22
|
|
|
|
|
|
|
$self->_get()->[$index]; |
23
|
|
|
|
|
|
|
} |
24
|
1
|
|
|
1
|
|
2
|
sub FETCHSIZE { |
25
|
1
|
|
|
|
|
6
|
my $self = shift; |
26
|
1
|
|
|
|
|
10
|
my $ary = $self->_get(); |
27
|
|
|
|
|
|
|
scalar @$ary; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
7
|
|
|
7
|
|
19
|
sub STORE { |
31
|
|
|
|
|
|
|
my ($self, $index, $val) = @_; |
32
|
|
|
|
|
|
|
|
33
|
7
|
|
|
7
|
|
17
|
$self->{share}->lock_cb(sub { |
34
|
7
|
|
|
|
|
21
|
my $share = $self->{share}; |
35
|
7
|
|
|
|
|
259
|
my $cur = $share->get_nolock('array'); |
36
|
7
|
|
|
|
|
29
|
$cur->[$index] = $val; |
37
|
7
|
|
|
|
|
85
|
$share->set_nolock(array => $cur); |
38
|
|
|
|
|
|
|
}); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |