line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::SharedFork::Scalar; |
2
|
31
|
|
|
31
|
|
154
|
use strict; |
|
31
|
|
|
|
|
61
|
|
|
31
|
|
|
|
|
744
|
|
3
|
31
|
|
|
31
|
|
156
|
use warnings; |
|
31
|
|
|
|
|
43
|
|
|
31
|
|
|
|
|
770
|
|
4
|
31
|
|
|
31
|
|
152
|
use base 'Tie::Scalar'; |
|
31
|
|
|
|
|
53
|
|
|
31
|
|
|
|
|
25767
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# create new tied scalar |
7
|
|
|
|
|
|
|
sub TIESCALAR { |
8
|
108
|
|
|
108
|
|
437
|
my ($class, $share, $key) = @_; |
9
|
108
|
50
|
|
|
|
315
|
die "missing key" unless $key; |
10
|
108
|
|
|
|
|
3041
|
bless { share => $share, key => $key }, $class; |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub FETCH { |
14
|
989
|
|
|
989
|
|
215370
|
my $self = shift; |
15
|
989
|
|
|
|
|
5111
|
my $lock = $self->{share}->get_lock(); |
16
|
989
|
|
|
|
|
5037
|
$self->{share}->get($self->{key}); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub STORE { |
20
|
253
|
|
|
253
|
|
1191
|
my ($self, $val) = @_; |
21
|
253
|
|
|
|
|
629
|
my $share = $self->{share}; |
22
|
253
|
|
|
|
|
1076
|
my $lock = $self->{share}->get_lock(); |
23
|
253
|
|
|
|
|
1582
|
$share->set($self->{key} => $val); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |