From: Junio C Hamano Date: Wed, 12 Jul 2017 16:46:25 GMT Subject: Re: [PATCH] gc: run pre-detach operations under lock Message-ID: In-Reply-To: <20170711090635.swowex7yry7kqb7v@sigill.intra.peff.net> Jeff King writes: > Instead, we can do something a bit simpler: take the lock > only for the duration of the pre-detach work, then detach, > then take it again for the post-detach work. Technically, > this means that the post-detach lock could lose to another > process doing pre-detach work. But in the long run this > works out. You might have found this part gross, but I actually don't. It looks like a reasonable practical compromise, and I tried to think of a scenario that this would do a wrong thing but I didn't---it is not like we carry information off-disk from the pre-detach to post-detach work to cause the latter make decisions on it, so this "split into two phrases" looks fairly safe.