/[wait]/cvs-head/lib/WAIT/Table.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /cvs-head/lib/WAIT/Table.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 35 by ulpfr, Sun Nov 12 17:00:27 2000 UTC revision 42 by ulpfr, Wed Nov 15 08:54:25 2000 UTC
# Line 4  Line 4 
4  # Author          : Ulrich Pfeifer  # Author          : Ulrich Pfeifer
5  # Created On      : Thu Aug  8 13:05:10 1996  # Created On      : Thu Aug  8 13:05:10 1996
6  # Last Modified By: Ulrich Pfeifer  # Last Modified By: Ulrich Pfeifer
7  # Last Modified On: Sun Nov 12 17:51:56 2000  # Last Modified On: Tue Nov 14 16:19:17 2000
8  # Language        : CPerl  # Language        : CPerl
9  # Update Count    : 148  # Update Count    : 149
10  # Status          : Unknown, Use with caution!  # Status          : Unknown, Use with caution!
11  #  #
12  # Copyright (c) 1996-1997, Ulrich Pfeifer  # Copyright (c) 1996-1997, Ulrich Pfeifer
# Line 381  sub open { Line 381  sub open {
381      }      }
382      require WAIT::InvertedIndex;      require WAIT::InvertedIndex;
383    }    }
384    
385      $self->getlock($self->{mode});
386    
387    unless (defined $self->{dbh}) {    unless (defined $self->{dbh}) {
388      if ($USE_RECNO) {      if ($USE_RECNO) {
389        $self->{dbh} = tie(@{$self->{db}}, 'DB_File', $file,        $self->{dbh} = tie(@{$self->{db}}, 'DB_File', $file,
# Line 392  sub open { Line 395  sub open {
395      }      }
396    }    }
397        
   $self->getlock($self->{mode});  
398        
399    $self;    $self;
400  }  }
# Line 661  sub close { Line 663  sub close {
663  # If a "write" lock is requested, an existing "read" lock will be  # If a "write" lock is requested, an existing "read" lock will be
664  # released.  If a "read" lock ist requested, an existing "write" lock  # released.  If a "read" lock ist requested, an existing "write" lock
665  # will be released.  Requiring a lock already hold has no effect.  # will be released.  Requiring a lock already hold has no effect.
666      
667  sub getlock {  sub getlock {
668    my ($self, $mode) = @_;    my ($self, $mode) = @_;
669      
670    my $lockmgr = LockFile::Simple->make(-autoclean => 1);    # autoclean cleans on DESTROY, stale sends SIGZERO to the owner
671      #
672      my $lockmgr = LockFile::Simple->make(-autoclean => 1, -stale => 1);
673    my $file    = $self->{file} . '/records';    my $file    = $self->{file} . '/records';
674    my $lockdir = $self->{file} . '/read';    my $lockdir = $self->{file} . '/read';
675    

Legend:
Removed from v.35  
changed lines
  Added in v.42

  ViewVC Help
Powered by ViewVC 1.1.26