line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#line 1 |
2
|
2
|
|
|
2
|
|
13
|
package Test::SharedFork::Scalar; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
71
|
|
3
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
57
|
|
4
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
2753
|
|
5
|
|
|
|
|
|
|
use base 'Tie::Scalar'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# create new tied scalar |
8
|
2
|
|
|
2
|
|
7
|
sub TIESCALAR { |
9
|
2
|
50
|
|
|
|
8
|
my ($class, $share, $key) = @_; |
10
|
2
|
|
|
|
|
17
|
die "missing key" unless $key; |
11
|
|
|
|
|
|
|
bless { share => $share, key => $key }, $class; |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
6
|
|
|
6
|
|
11
|
sub FETCH { |
15
|
6
|
|
|
|
|
53
|
my $self = shift; |
16
|
6
|
|
|
|
|
133
|
my $lock = $self->{share}->get_lock(); |
17
|
|
|
|
|
|
|
$self->{share}->get($self->{key}); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
0
|
|
|
sub STORE { |
21
|
0
|
|
|
|
|
|
my ($self, $val) = @_; |
22
|
0
|
|
|
|
|
|
my $share = $self->{share}; |
23
|
0
|
|
|
|
|
|
my $lock = $self->{share}->get_lock(); |
24
|
|
|
|
|
|
|
$share->set($self->{key} => $val); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |