line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::SharedFork::Scalar; |
2
|
31
|
|
|
31
|
|
346
|
use strict; |
|
31
|
|
|
|
|
57
|
|
|
31
|
|
|
|
|
744
|
|
3
|
31
|
|
|
31
|
|
157
|
use warnings; |
|
31
|
|
|
|
|
48
|
|
|
31
|
|
|
|
|
782
|
|
4
|
31
|
|
|
31
|
|
158
|
use base 'Tie::Scalar'; |
|
31
|
|
|
|
|
56
|
|
|
31
|
|
|
|
|
25271
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# create new tied scalar |
7
|
|
|
|
|
|
|
sub TIESCALAR { |
8
|
108
|
|
|
108
|
|
632
|
my ($class, $share, $key) = @_; |
9
|
108
|
50
|
|
|
|
350
|
die "missing key" unless $key; |
10
|
108
|
|
|
|
|
3524
|
bless { share => $share, key => $key }, $class; |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub FETCH { |
14
|
989
|
|
|
989
|
|
245815
|
my $self = shift; |
15
|
989
|
|
|
|
|
5328
|
my $lock = $self->{share}->get_lock(); |
16
|
989
|
|
|
|
|
5335
|
$self->{share}->get($self->{key}); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub STORE { |
20
|
253
|
|
|
253
|
|
1598
|
my ($self, $val) = @_; |
21
|
253
|
|
|
|
|
801
|
my $share = $self->{share}; |
22
|
253
|
|
|
|
|
1279
|
my $lock = $self->{share}->get_lock(); |
23
|
253
|
|
|
|
|
1619
|
$share->set($self->{key} => $val); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |