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

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

revision 65 by ulpfr, Wed Nov 15 08:54:25 2000 UTC revision 66 by ulpfr, Wed Jan 23 13:16:05 2002 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: Tue Nov 14 16:19:17 2000  # Last Modified On: Wed Jan 23 14:15:15 2002
8  # Language        : CPerl  # Language        : CPerl
9  # Update Count    : 149  # Update Count    : 152
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 720  sub getlock { Line 720  sub getlock {
720      return $self if $self->{read_lock};      return $self if $self->{read_lock};
721    
722      # Get the preliminary write lock to protect the directory      # Get the preliminary write lock to protect the directory
723      # operations.  If we already have a write lock, it will go.      # operations.
724    
725      $self->{write_lock} ||= $lockmgr->lock($self->{file} . '/write')      my $write_lock = $lockmgr->lock($self->{file} . '/read/write')
726        or die "Can't lock '$self->{file}/write'";        or die "Can't lock '$self->{file}/read/write'";
727    
728      # Find a new read slot.  Maybe the plain file would be better?      # Find a new read slot.  Maybe the plain file would be better?
729      my $id = time;      my $id = time;
# Line 735  sub getlock { Line 735  sub getlock {
735        or die "Can't lock '$lockdir/$id'";        or die "Can't lock '$lockdir/$id'";
736    
737      # We are a reader now. So we release the write lock      # We are a reader now. So we release the write lock
738      $self->{write_lock}->release;      $write_lock->release;
     delete $self->{write_lock};  
739    }    }
740    return $self;    return $self;
741  }  }

Legend:
Removed from v.65  
changed lines
  Added in v.66

  ViewVC Help
Powered by ViewVC 1.1.26