Re: [PATCH 2/3] index-pack: drop type_cas mutex

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

 



> The type_cas lock lost all of its callers in f08cbf60fe (index-pack:
> make quantum of work smaller, 2020-09-08), so we can safely delete it.
> The compiler didn't alert us that the variable became unused, because we
> still call pthread_mutex_init() and pthread_mutex_destroy() on it.
> 
> It's worth considering also whether that commit was in error to remove
> the use of the lock. Why don't we need it now, if we did before, as
> described in ab791dd138 (index-pack: fix race condition with duplicate
> bases, 2014-08-29)? I think the answer is that we now look at and assign
> the child_obj->real_type field in the main thread while holding the
> work_lock(). So we don't have to worry about racing with the worker
> threads.

Yeah - I probably should have made the change without removing the
compare-and-swap, and then removed the compare-and-swap in a subsequent
patch. Thanks for catching this.



[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