diff options
author | Eric Wong <e@80x24.org> | 2024-04-01 06:49:36 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2024-04-03 08:28:03 +0000 |
commit | 9aba037ad27f1ec8e9c37580d23ea7a8944e8ae5 (patch) | |
tree | 8db631dc468a4ac21124de076d266a2e07585a5b /lib/PublicInbox | |
parent | 7de64dc25f8348f902f2815d520ecce3d0e90ca8 (diff) | |
download | public-inbox-9aba037ad27f1ec8e9c37580d23ea7a8944e8ae5.tar.gz |
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.
Diffstat (limited to 'lib/PublicInbox')
-rw-r--r-- | lib/PublicInbox/LeiMirror.pm | 2 | ||||
-rw-r--r-- | lib/PublicInbox/Lock.pm | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/PublicInbox/LeiMirror.pm b/lib/PublicInbox/LeiMirror.pm index 5353ae61..4e3e1d1c 100644 --- a/lib/PublicInbox/LeiMirror.pm +++ b/lib/PublicInbox/LeiMirror.pm @@ -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'); diff --git a/lib/PublicInbox/Lock.pm b/lib/PublicInbox/Lock.pm index ddaf3312..2a5a0f30 100644 --- a/lib/PublicInbox/Lock.pm +++ b/lib/PublicInbox/Lock.pm @@ -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; |