git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Patrick Hogg <phogg@novamoon.net>
Date
Jan 25, 2019, 00:20 UTC
Message-ID
<CAFOcBz=8gWeN7Zm346FAgwdAaMdbTk3zzRMx0LTm-OTQTkJx-Q@mail.gmail.com>
In-Reply-To
<xmqq7eetj0ph.fsf@gitster-ct.c.googlers.com>
On Thu, Jan 24, 2019 at 2:49 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 26 quoted lines
>
> Duy Nguyen <pclouds@gmail.com> writes:
>
> > On Thu, Jan 24, 2019 at 8:06 AM Patrick Hogg <phogg@novamoon.net> 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!
Previous: Junio C HamanoNext: Duy Nguyen
Message 5 of 6 in “pack-objects: move read mutex to packing_data struct”
  1. 1/2 pack-objects: move read mutex to packing_data structPatrick Hogg, Jan 24, 2019
  2. 2/2 pack-objects: merge read_lock and lock in packing_data structPatrick Hogg, Jan 24, 2019
  3. Duy NguyenJan 24, 2019
  4. Junio C HamanoJan 24, 2019
  5. Patrick HoggJan 25, 2019
  6. Duy NguyenJan 24, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.