about summary refs log tree commit homepage
path: root/lib/PublicInbox/Lock.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2020-12-31 13:51:54 +0000
committerEric Wong <e@80x24.org>2021-01-01 05:00:40 +0000
commit0d6777e0389fe2db3edce41d675320746433f5b7 (patch)
treebd74fac722a93a2432e472e9b5c9797a41737f5f /lib/PublicInbox/Lock.pm
parent3823705b72199c61e8ed96aabd34d21a63fe153c (diff)
downloadpublic-inbox-0d6777e0389fe2db3edce41d675320746433f5b7.tar.gz
Since we'll be forking for Xapian indexing and maybe
other places, having a simple guard in place to ensure
OnDestroy doesn't unexpectedly unlink files or similar
is a safer option.
Diffstat (limited to 'lib/PublicInbox/Lock.pm')
-rw-r--r--lib/PublicInbox/Lock.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/Lock.pm b/lib/PublicInbox/Lock.pm
index f6eaa5ce..1d0b4f9c 100644
--- a/lib/PublicInbox/Lock.pm
+++ b/lib/PublicInbox/Lock.pm
@@ -36,9 +36,9 @@ sub lock_release {
 
 # caller must use return value
 sub lock_for_scope {
-        my ($self) = @_;
+        my ($self, @single_pid) = @_;
         $self->lock_acquire;
-        PublicInbox::OnDestroy->new(\&lock_release, $self);
+        PublicInbox::OnDestroy->new(@single_pid, \&lock_release, $self);
 }
 
 sub new_tmp {