This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch for PR libgomp/37938, IA64 specific.


On Thu, 2008-11-06 at 09:56 -0800, H.J. Lu wrote:

> Shouldn't we use __sync_lock_test_and_set  to initialize mutux?
> 
> 
> H.J.
> --- libgomp/config/linux/mutex.h.sync	2006-11-18 06:22:18.000000000 -0800
> +++ libgomp/config/linux/mutex.h	2008-11-06 09:50:46.000000000 -0800
> @@ -38,7 +38,7 @@ typedef int gomp_mutex_t;
> 
>  static inline void gomp_mutex_init (gomp_mutex_t *mutex)
>  {
> -  *mutex = 0;
> +  __sync_lock_test_and_set (mutex, 0);
>  }
> 
>  extern void gomp_mutex_lock_slow (gomp_mutex_t *mutex);

I was wondering about the initialization but this patch didn't seem to
fix the test case in PR 37938 when I added it and then removed my
patches.

Steve Ellcey
sje@cup.hp.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]