]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
lock: get rid of PID guard
authorEric Wong <e@80x24.org>
Mon, 1 Apr 2024 06:49:36 +0000 (06:49 +0000)
committerEric Wong <e@80x24.org>
Wed, 3 Apr 2024 08:28:03 +0000 (08:28 +0000)
PID guards for OnDestroy will be the default in an upcoming
change.  In the meantime, LeiMirror was the only user and
didn't actually need it.

lib/PublicInbox/LeiMirror.pm
lib/PublicInbox/Lock.pm

index 5353ae61c40249d65a7cdffc4b9862681f1fa8cd..4e3e1d1c8a35b8b0b96417de8574061cd9f12ff6 100644 (file)
@@ -856,7 +856,7 @@ sub v2_done { # called via OnDestroy
        my $dst = $self->{cur_dst} // $self->{dst};
        require PublicInbox::Lock;
        my $lk = PublicInbox::Lock->new("$dst/inbox.lock");
-       my $lck = $lk->lock_for_scope($$);
+       my $lck = $lk->lock_for_scope;
        _write_inbox_config($self);
        require PublicInbox::MultiGit;
        my $mg = PublicInbox::MultiGit->new($dst, 'all.git', 'git');
index ddaf3312ade566b50b6d051b32772c846107337b..2a5a0f308295f812f55d72b162dc9ca64e6c7058 100644 (file)
@@ -41,9 +41,9 @@ sub lock_release {
 
 # caller must use return value
 sub lock_for_scope {
-       my ($self, @single_pid) = @_;
+       my ($self) = @_;
        lock_acquire($self) or return; # lock_path not set
-       PublicInbox::OnDestroy->new(@single_pid, \&lock_release, $self);
+       PublicInbox::OnDestroy->new(\&lock_release, $self);
 }
 
 sub lock_acquire_fast {
@@ -58,9 +58,9 @@ sub lock_release_fast {
 
 # caller must use return value
 sub lock_for_scope_fast {
-       my ($self, @single_pid) = @_;
+       my ($self) = @_;
        lock_acquire_fast($self) or return; # lock_path not set
-       PublicInbox::OnDestroy->new(@single_pid, \&lock_release_fast, $self);
+       PublicInbox::OnDestroy->new(\&lock_release_fast, $self);
 }
 
 1;