/[wait]/trunk/lib/WAIT/Database.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 /trunk/lib/WAIT/Database.pm

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

cvs-head/lib/WAIT/Database.pm revision 20 by cvs2svn, Tue May 9 11:29:45 2000 UTC trunk/lib/WAIT/Database.pm revision 88 by dpavlin, Mon May 24 13:44:01 2004 UTC
# Line 4  Line 4 
4  # Author          : Ulrich Pfeifer  # Author          : Ulrich Pfeifer
5  # Created On      : Thu Aug  8 09:44:13 1996  # Created On      : Thu Aug  8 09:44:13 1996
6  # Last Modified By: Ulrich Pfeifer  # Last Modified By: Ulrich Pfeifer
7  # Last Modified On: Sat Apr 15 16:15:29 2000  # Last Modified On: Sat Apr 27 16:48:24 2002
8  # Language        : CPerl  # Language        : CPerl
9  #  #
10  # (C) Copyright 1996-2000, Ulrich Pfeifer  # (C) Copyright 1996-2000, Ulrich Pfeifer
# Line 106  sub create { Line 106  sub create {
106    $self->{file}      = "$dir/$name";    $self->{file}      = "$dir/$name";
107    $self->{uniqueatt} = $parm{uniqueatt};    $self->{uniqueatt} = $parm{uniqueatt};
108    $self->{mode}      = O_CREAT;    $self->{mode}      = O_CREAT;
109    my $lockmgr = LockFile::Simple->make(-autoclean => 1);    my $lockmgr = LockFile::Simple->make(-autoclean => 1, -stale => 1);
110    # aquire a write lock    # aquire a write lock
111    $self->{write_lock} = $lockmgr->lock("$dir/$name/write")    $self->{write_lock} = $lockmgr->lock("$dir/$name/write")
112      or die "Can't lock '$dir/$name/write'";      or die "Can't lock '$dir/$name/write'";
# Line 153  sub open { Line 153  sub open {
153    
154    if ($self->{mode} & O_RDWR) {    if ($self->{mode} & O_RDWR) {
155      # Locking: We do not care about read access since write is atomic.      # Locking: We do not care about read access since write is atomic.
156      my $lockmgr = LockFile::Simple->make(-autoclean => 1);      my $lockmgr = LockFile::Simple->make(-autoclean => 1, -stale => 1);
157            
158      # aquire a write lock      # aquire a write lock
159      $self->{write_lock} = $lockmgr->lock("$dir/$name/write")      $self->{write_lock} = $lockmgr->lock("$dir/$name/write")
# Line 318  sub table { Line 318  sub table {
318      }      }
319      WAIT::Table::Handle->new($self,$name);      WAIT::Table::Handle->new($self,$name);
320    } else {    } else {
321      croak "No such table '$name'";      print STDERR "No such table '$name'\n";
322        return;
323    }    }
324  }  }
325    

Legend:
Removed from v.20  
changed lines
  Added in v.88

  ViewVC Help
Powered by ViewVC 1.1.26