Re: [PATCH v3 2/2] pack-objects: merge read_lock and lock in packing_data struct

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 24, 2019 at 2:49 PM Junio C Hamano <gitster@xxxxxxxxx> wrote:
>
> Duy Nguyen <pclouds@xxxxxxxxx> writes:
>
> > On Thu, Jan 24, 2019 at 8:06 AM Patrick Hogg <phogg@xxxxxxxxxxxx> wrote:
> >> diff --git a/pack-objects.h b/pack-objects.h
> >> index 0a038e3bc..dc869f26c 100644
> >> --- a/pack-objects.h
> >> +++ b/pack-objects.h
> >> @@ -146,7 +146,6 @@ struct packing_data {
> >>         struct packed_git **in_pack;
> >>
> >>         pthread_mutex_t lock;
> >> -       pthread_mutex_t read_lock;
> >
> > "lock" without any comments in this struct, to me, implies that it
> > protects access to this struct alone. But since you're using it as
> > "read lock" (aka access to object database), I think you should add a
> > comment here clarify the new role of "lock" variable.
>
> Sounds sensible.  How about squashing something like this in?
>
> Some older part of this file still tries to hide the reliance on the
> global variable "to_pack", but newer code refers to it already, and
> I think it no longer is buying us much.
>
>  [snip]

Sounds good to me, I'm going to shamelessly use exactly that
(with a Thanks-to:) as I have no better suggestions for comments.

Thanks all for the support in my first ever git.git patch!



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux