line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::SharedFork::Scalar; |
2
|
31
|
|
|
31
|
|
130
|
use strict; |
|
31
|
|
|
|
|
36
|
|
|
31
|
|
|
|
|
947
|
|
3
|
31
|
|
|
31
|
|
118
|
use warnings; |
|
31
|
|
|
|
|
33
|
|
|
31
|
|
|
|
|
711
|
|
4
|
31
|
|
|
31
|
|
110
|
use base 'Tie::Scalar'; |
|
31
|
|
|
|
|
40
|
|
|
31
|
|
|
|
|
17431
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# create new tied scalar |
7
|
|
|
|
|
|
|
sub TIESCALAR { |
8
|
108
|
|
|
108
|
|
314
|
my ($class, $share, $key) = @_; |
9
|
108
|
50
|
|
|
|
214
|
die "missing key" unless $key; |
10
|
108
|
|
|
|
|
2000
|
bless { share => $share, key => $key }, $class; |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub FETCH { |
14
|
989
|
|
|
989
|
|
147438
|
my $self = shift; |
15
|
989
|
|
|
|
|
3405
|
my $lock = $self->{share}->get_lock(); |
16
|
989
|
|
|
|
|
3921
|
$self->{share}->get($self->{key}); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub STORE { |
20
|
253
|
|
|
253
|
|
712
|
my ($self, $val) = @_; |
21
|
253
|
|
|
|
|
602
|
my $share = $self->{share}; |
22
|
253
|
|
|
|
|
773
|
my $lock = $self->{share}->get_lock(); |
23
|
253
|
|
|
|
|
1540
|
$share->set($self->{key} => $val); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |