This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RESEND PATCH 1/3] Mutex: Accelerate lock acquisition by queuing spinner
On 2018/12/17 下午8:55, Florian Weimer wrote:
> * Kemi Wang:
>
>> +# define PTHREAD_QUEUESPINNER_MUTEX_INITIALIZER_NP \
>> + { { 0, 0, 0, PTHREAD_MUTEX_QUEUESPINNER_NP, { 0, 0, 0, 0 }, 0, \
>> + { __PTHREAD_SPINS }, { 0, 0 } } }
>
> Is it really necessary to add the initializer?
>
Not really.
But I prefer to keep it here because of ease of use.
Also, there are other initializers for other types of mutex, we'd better
keep the same style.
> Without it, we can remove all references to
> PTHREAD_QUEUESPINNER_MUTEX_INITIALIZER_NP from the hot path in case
> something better comes up.
>
> Thanks,
> Florian
>