diff options
author | Eric Wong (Contractor, The Linux Foundation) <e@80x24.org> | 2018-03-19 08:14:40 +0000 |
---|---|---|
committer | Eric Wong (Contractor, The Linux Foundation) <e@80x24.org> | 2018-03-19 08:16:34 +0000 |
commit | cf1e5bcfeacd5b2a3b8e82052a65e69cd1e0cc57 (patch) | |
tree | 40349e63eafe0bf7871e94f98576f4db1962502f /lib | |
parent | eb48e7d6675babdda9a36be1a490c29a2ccddbdc (diff) | |
download | public-inbox-cf1e5bcfeacd5b2a3b8e82052a65e69cd1e0cc57.tar.gz |
Writing to the main skeleton pipe requires a lock since it's shared with partition processes.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/PublicInbox/SearchIdxSkeleton.pm | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/PublicInbox/SearchIdxSkeleton.pm b/lib/PublicInbox/SearchIdxSkeleton.pm index beb17b9f..51a88fda 100644 --- a/lib/PublicInbox/SearchIdxSkeleton.pm +++ b/lib/PublicInbox/SearchIdxSkeleton.pm @@ -149,9 +149,12 @@ sub index_skeleton_real ($$) { # write to the subprocess sub barrier_init { my ($self, $nparts) = @_; - my $w = $_[0]->{w}; - print $w "barrier_init $nparts\n" or die "failed to write: $!"; - $w->flush or die "failed to flush: $!"; + my $w = $self->{w}; + my $err; + $self->_lock_acquire; + print $w "barrier_init $nparts\n" or $err = "failed to write: $!\n"; + $self->_lock_release; + die $err if $err; } sub barrier_wait { |