Re: Support pthread with no recursive mutex (SunOS 5.6)

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

 



Jonathan Nieder <jrnieder@xxxxxxxxx> writes:

> Hi Gary,
>
> Gary V. Vaughan wrote:
>
>> Thanks for merging my last patch series into the new release.  git 1.7.3.2
>> now compiles correctly on all of our hosts, save Solaris 2.6 (SunOS 5.6)
>> which has no recursive mutex support in its pthreads.
>
> Nice.
>
>> --- a/builtin/pack-objects.c
>> +++ b/builtin/pack-objects.c
>> @@ -1561,7 +1561,11 @@ static pthread_cond_t progress_cond;
>>   */
>>  static void init_threaded_search(void)
>>  {
>> +#ifndef NO_RECURSIVE_MUTEX
>>  	init_recursive_mutex(&read_mutex);
>> +#else
>> +	pthread_mutex_init(&read_mutex, NULL);
>> +#endif
>
> Wouldn't that defeat the purpose of using a recursive mutex in the first
> place?

Thanks for a sanity.

What might make sense is not NO_RECURSIVE_MUTEX but MUTEX_IS_RECURSIVE
(which would be the Windows case).  If Solaris 2.6 has mutex without
PTHREAD_MUTEX_RECURSIVE, and its mutex is already recursive without being
told anything special, then something like the above patch (#ifdef should
be in the definition of init_recursive_mutex() function, not its callsite,
by the way) would be a good thing to have, but I somehow doubt that it
would be the case...
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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]