IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4632 for trunk/Nebulous/lib


Ignore:
Timestamp:
Jul 27, 2005, 3:38:26 PM (21 years ago)
Author:
jhoblitt
Message:

remove commented auto-lock code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous/lib/Nebulous/Client.pm

    r4440 r4632  
    11# Copyright (c) 2004  Joshua Hoblitt
    22#
    3 # $Id: Client.pm,v 1.15 2005-06-30 02:35:06 jhoblitt Exp $
     3# $Id: Client.pm,v 1.16 2005-07-28 01:38:26 jhoblitt Exp $
    44
    55package Nebulous::Client;
     
    126126    $log->debug( "server allocated $uri" );
    127127
    128 #    unless( $self->lock( $key, "write"  )) {
    129 #        $log->debug( "can not lock object" );
    130 #        $log->debug( "leaving" );
    131 #
    132 #        return undef;
    133 #    }
    134 
    135128    my $fh;
    136129    eval {
     
    195188    close( $new_fh ) or $log->logdie( "can not close $key" );
    196189
    197 #    unless ($self->unlock( $key, "write" )) {
    198 #        $log->debug( "can not lock object" );
    199 #        $log->debug( "leaving" );
    200 #
    201 #        return undef;
    202 #    }
    203 
    204190    $log->debug( "leaving" );
    205191
     
    234220    }
    235221
    236     # make sure nobody is reading while we are deleting
    237 #    unless ($self->lock( $key, "write" )) {
    238 #        $log->debug( "can not lock object" );
    239 #        $log->debug( "leaving" );
    240 #
    241 #        return undef;
    242 #    }
    243 
    244222    my $uri = $self->delete_instance( $locations->[0] );
    245 
    246 #    unless ($self->unlock( $key, "write" )) {
    247 #        $log->debug( "can not lock object" );
    248 #        $log->debug( "leaving" );
    249 #
    250 #        return undef;
    251 #    }
    252223
    253224    $log->debug( "leaving" );
     
    466437
    467438    if ( $type eq 'write' ) {
    468 #        unless ($self->lock( $key, $type )) {
    469 #            $log->debug( "can not lock object" );
    470 #            $log->debug( "leaving" );
    471 #
    472 #            return undef;
    473 #        }
    474 
    475439        eval {
    476440            $fh = _get_filehandle( $path, '+<' );
     
    478442        $log->logdie( $@ ) if $@;
    479443    } elsif ( $type eq 'read' ) {
    480 #            unless ($self->lock( $key, $type )) {
    481 #            $log->debug( "can not lock object" );
    482 #            $log->debug( "leaving" );
    483 #
    484 #            return undef;
    485 #        }
    486 
    487444        eval {
    488445            $fh = _get_filehandle( $path, '<' );
     
    507464    $log->debug( "entered - @_" );
    508465
    509 #    unless ($self->lock( $key, "write" )) {
    510 #        $log->debug( "can not lock object" );
    511 #        $log->debug( "leaving" );
    512 #
    513 #        return undef;
    514 #    }
    515 
    516466    my $locations = $self->find_instances( $key );
    517467
    518468    return undef unless $locations;
    519469       
     470    # a lock is implicitly removed when the last storage object is deleted
    520471    foreach my $uri ( @$locations ) {
    521472        $self->delete_instance( $uri ) or return undef;
    522473    }
    523 
    524     # lock is implicitly removed when the last storage object is deleted
    525474
    526475    $log->debug( "leaving" );
     
    563512    close( $fh ) or $log->logdie->( "can not close $key" );
    564513    close( $new_fh ) or $log->logdie->( "can not close $new_key" );
    565 
    566 #    unless ($self->unlock( $key, "read" )) {
    567 #        $log->debug( "can not lock object" );
    568 #        $log->debug( "leaving" );
    569 #
    570 #        return undef;
    571 #    }
    572 #
    573 #    unless ($self->unlock( $new_key, "write" )) {
    574 #        $log->debug( "can not lock object" );
    575 #        $log->debug( "leaving" );
    576 #
    577 #        return undef;
    578 #    }
    579514
    580515    $log->debug( "leaving" );
Note: See TracChangeset for help on using the changeset viewer.