CHI-Driver-SharedMem
view release on metacpan or search on metacpan
lib/CHI/Driver/SharedMem.pm view on Meta::CPAN
# }
my $self = shift;
# open(my $tulip, '>>', '/tmp/tulip');
# print $tulip "DEMOLISH\n";
if($self->shm_key() && $self->shm()) {
$self->_lock(type => 'write');
my $cur_size = $self->_data_size();
# print $tulip "DEMOLISH: $cur_size bytes\n";
my $can_remove = 0;
my $stat = $self->shm()->stat();
if($cur_size == 0) {
if(defined($stat) && ($stat->nattch() == 1)) {
$self->shm()->detach();
$self->shm()->remove();
$can_remove = 1;
}
# } elsif(defined($stat) && ($stat->nattch() == 1)) {
# # Scan the cache and see if all has expired.
# # If it has, then the cache can be removed if nattch = 1
# $can_remove = 1;
( run in 0.631 second using v1.01-cache-2.11-cpan-49f99fa48dc )