Re: [PATCH 02/10] index-pack: remove #ifdef NO_PTHREADS

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

 



On Sat, Oct 27, 2018 at 09:09:55AM +0200, Nguyễn Thái Ngọc Duy wrote:

>  static inline struct thread_local *get_thread_data(void)
>  {
> -#ifndef NO_PTHREADS
> -	if (threads_active)
> -		return pthread_getspecific(key);
> -	assert(!threads_active &&
> -	       "This should only be reached when all threads are gone");
> -#endif
> +	if (HAVE_THREADS) {
> +		if (threads_active)
> +			return pthread_getspecific(key);
> +		assert(!threads_active &&
> +		       "This should only be reached when all threads are gone");
> +	}
>  	return &nothread_data;
>  }
>  
> -#ifndef NO_PTHREADS
>  static void set_thread_data(struct thread_local *data)
>  {
>  	if (threads_active)
>  		pthread_setspecific(key, data);
>  }
> -#endif

If we do the getspecific/setspecific thing I mentioned for the previous
patch, then I think helpers like this can just go away.

-Peff



[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