##
# Close database FileHandle
##
-# my $self = _get_self($_[0]);
-# undef $self->root->{fh};
- #XXX Should it be this??
- #close $self->root->{fh};
+ my $self = _get_self($_[0]);
+ close $self->root->{fh};
}
sub _create_tag {
if ($self->root->{locking}) {
if (!$self->root->{locked}) { flock($self->fh, $type); }
$self->root->{locked}++;
+
+ return 1;
}
+
+ return;
}
sub unlock {
if ($self->root->{locking} && $self->root->{locked} > 0) {
$self->root->{locked}--;
if (!$self->root->{locked}) { flock($self->fh, LOCK_UN); }
+
+ return 1;
}
+
+ return;
}
#XXX These uses of ref() need verified
} qr/^DBM::Deep: Signature not found -- file is not a Deep DB/, "Only DBM::Deep DB files will be opened";
TODO: {
- todo_skip "lock() doesn't check to see if the file is open", 1;
+ local $TODO = "lock() doesn't check to see if the file is open";
my $db = DBM::Deep->new(
file => 't/test.db',
locking => 1,
}
TODO: {
- todo_skip "unlock() doesn't check to see if the file is open", 1;
+ local $TODO = "unlock() doesn't check to see if the file is open";
my $db = DBM::Deep->new(
file => 't/test.db',
locking => 1,