Re: [PATCH v2] grep: take the read-lock when adding a submodule

2017-11-01 Thread Jeff King
On Wed, Nov 01, 2017 at 09:45:06PM +0100, Martin Ågren wrote: > With --recurse-submodules, we add each submodule that we encounter to > the list of alternate object databases. With threading, our changes to > the list are not protected against races. Indeed, ThreadSanitizer > reports a race when w

Re: [PATCH v2] grep: take the read-lock when adding a submodule

2017-11-01 Thread Brandon Williams
On 11/01, Martin Ågren wrote: > With --recurse-submodules, we add each submodule that we encounter to > the list of alternate object databases. With threading, our changes to > the list are not protected against races. Indeed, ThreadSanitizer > reports a race when we call `add_to_alternates_memory(

[PATCH v2] grep: take the read-lock when adding a submodule

2017-11-01 Thread Martin Ågren
With --recurse-submodules, we add each submodule that we encounter to the list of alternate object databases. With threading, our changes to the list are not protected against races. Indeed, ThreadSanitizer reports a race when we call `add_to_alternates_memory()` around the same time that another t