Re: [PATCHv2 1/2] attr: convert to new threadsafe API
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 27, 2016, 00:16 UTC
- Message-ID
- <xmqqfuniabo6.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <CAGZ79kaR4DddoHQNUUvRAY=_PK5qqS=ws_Wkfa-EXT2seN5b=A@mail.gmail.com>
Stefan Beller <sbeller@google.com> writes:
Show 5 quoted lines
> +* Allocate an array of `struct git_attr_result` either on the stack > + or via `git_attr_result_alloc` on the heap when the result size > + is not known at compile time. The call to initialize > the result is not thread safe, because different threads need their > own thread local result anyway.
Do you want to keep the last sentence? "The call to initialize the result is not thread safe..."? Is that true?
Show 7 quoted lines
> @@ -103,7 +105,7 @@ To see how attributes "crlf" and "ident" are set > for different paths. > const char *path; > struct git_attr_result result[2]; > > - git_check_attr(path, check, result); > + git_check_attr(path, &check, result);
What's the point of this change? Isn't check typically a pointer already?