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

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

revision 85 by ulpfr, Fri May 3 16:16:10 2002 UTC revision 86 by dpavlin, Mon May 24 13:41:28 2004 UTC
# 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.85  
changed lines
  Added in v.86

  ViewVC Help
Powered by ViewVC 1.1.26