661 |
# If a "write" lock is requested, an existing "read" lock will be |
# If a "write" lock is requested, an existing "read" lock will be |
662 |
# released. If a "read" lock ist requested, an existing "write" lock |
# released. If a "read" lock ist requested, an existing "write" lock |
663 |
# will be released. Requiring a lock already hold has no effect. |
# will be released. Requiring a lock already hold has no effect. |
664 |
|
|
665 |
sub getlock { |
sub getlock { |
666 |
my ($self, $mode) = @_; |
my ($self, $mode) = @_; |
667 |
|
|
668 |
my $lockmgr = LockFile::Simple->make(-autoclean => 1); |
# autoclean cleans on DESTROY, stale sends SIGZERO to the owner |
669 |
|
# |
670 |
|
my $lockmgr = LockFile::Simple->make(-autoclean => 1, -stale => 1); |
671 |
my $file = $self->{file} . '/records'; |
my $file = $self->{file} . '/records'; |
672 |
my $lockdir = $self->{file} . '/read'; |
my $lockdir = $self->{file} . '/read'; |
673 |
|
|