diff options
author | Geoff Norton <grompf@sublimeintervention.com> | 2008-08-12 23:40:15 +0400 |
---|---|---|
committer | Geoff Norton <grompf@sublimeintervention.com> | 2008-08-12 23:40:15 +0400 |
commit | fdb1da882bd835e2114b80ae5cb54968dc4e486e (patch) | |
tree | bb7e97a7d956ba6b01f916c49753a2b8014c42e5 /libgc/pthread_support.c | |
parent | fdbd13881cd56c0e7d4fa00847170c358158973d (diff) |
2008-08-12 Geoff Norton <gnorton@novell.com>
* pthread_support.c: GCC shipped with SLES9 ppc gets confused with our current
GC_setspecific define. Unfold the define into a static inline on all platforms
except ppc where it is a static leaf function.
svn path=/trunk/mono/; revision=110289
Diffstat (limited to 'libgc/pthread_support.c')
-rw-r--r-- | libgc/pthread_support.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/libgc/pthread_support.c b/libgc/pthread_support.c index 7b0c084e8bb..11d2cd6ad71 100644 --- a/libgc/pthread_support.c +++ b/libgc/pthread_support.c @@ -97,8 +97,11 @@ typedef pthread_key_t GC_key_t; # endif # if defined(USE_COMPILER_TLS) +/* Note sles9 gcc on powerpc gets confused by the define to set GC_thread_tls and pthread_setspecific + * so we actually use a static inline function decalred below that is equivalent to: + * define GC_setspecific(key, v) (GC_thread_tls = (v), pthread_setspecific ((key), (v))) + */ # define GC_getspecific(x) (GC_thread_tls) -# define GC_setspecific(key, v) (GC_thread_tls = (v), pthread_setspecific ((key), (v))) # define GC_key_create pthread_key_create typedef pthread_key_t GC_key_t; # endif @@ -191,14 +194,19 @@ static GC_key_t GC_thread_key; #ifdef USE_COMPILER_TLS +__thread MONO_TLS_FAST void* GC_thread_tls; + /* * gcc errors out with /tmp/ccdPMFuq.s:2994: Error: symbol `.LTLS4' is already defined - * if the static is removed on ppc. + * if the inline is added on powerpc */ -#if defined(__ppc__) || defined(__powerpc__) -static +#if !defined(__ppc__) && !defined(__powerpc__) +inline #endif -__thread MONO_TLS_FAST void* GC_thread_tls; +static int GC_setspecific (GC_key_t key, void *value) { + GC_thread_tls = value; + return pthread_setspecific (key, value); +} #endif static GC_bool keys_initialized; |