diff options
author | Adam Jackson <ajax@redhat.com> | 2011-03-02 11:17:07 -0500 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2011-03-08 13:22:01 -0500 |
commit | 2371b44f9eb9181ec2c081ce66befee51d18bf6e (patch) | |
tree | a89f64aacb2b8540512c0a27f43f60bdcbd3ecf1 /glx | |
parent | a5fdd1aa06c7c8ecefeafafc4a778fc816ad41a4 (diff) |
glx: unifdef SOLARIS_THREADS
Solaris 7 and older are not supported; Solaris 8 and later have (and
use) pthreads.
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'glx')
-rw-r--r-- | glx/glthread.c | 70 | ||||
-rw-r--r-- | glx/glthread.h | 25 |
2 files changed, 1 insertions, 94 deletions
diff --git a/glx/glthread.c b/glx/glthread.c index 8b9f61885..2d76a49b7 100644 --- a/glx/glthread.c +++ b/glx/glthread.c @@ -114,76 +114,6 @@ _glthread_SetTSD(_glthread_TSD *tsd, void *ptr) #endif /* PTHREADS */ - - -/* - * Solaris/Unix International Threads -- Use only if POSIX threads - * aren't available on your Unix platform. Solaris 2.[34] are examples - * of platforms where this is the case. Be sure to use -mt and/or - * -D_REENTRANT when compiling. - */ -#ifdef SOLARIS_THREADS -#define USE_LOCK_FOR_KEY /* undef this to try a version without - lock for the global key... */ - -_X_EXPORT unsigned long -_glthread_GetID(void) -{ - OsAbort(); /* XXX not implemented yet */ - return (unsigned long) 0; -} - - -void -_glthread_InitTSD(_glthread_TSD *tsd) -{ - if ((errno = mutex_init(&tsd->keylock, 0, NULL)) != 0 || - (errno = thr_keycreate(&(tsd->key), free)) != 0) { - perror(INIT_TSD_ERROR); - exit(-1); - } - tsd->initMagic = INIT_MAGIC; -} - - -void * -_glthread_GetTSD(_glthread_TSD *tsd) -{ - void* ret; - if (tsd->initMagic != INIT_MAGIC) { - _glthread_InitTSD(tsd); - } -#ifdef USE_LOCK_FOR_KEY - mutex_lock(&tsd->keylock); - thr_getspecific(tsd->key, &ret); - mutex_unlock(&tsd->keylock); -#else - if ((errno = thr_getspecific(tsd->key, &ret)) != 0) { - perror(GET_TSD_ERROR); - exit(-1); - } -#endif - return ret; -} - - -void -_glthread_SetTSD(_glthread_TSD *tsd, void *ptr) -{ - if (tsd->initMagic != INIT_MAGIC) { - _glthread_InitTSD(tsd); - } - if ((errno = thr_setspecific(tsd->key, ptr)) != 0) { - perror(SET_TSD_ERROR); - exit(-1); - } -} - -#undef USE_LOCK_FOR_KEY -#endif /* SOLARIS_THREADS */ - - - /* * Win32 Threads. The only available option for Windows 95/NT. * Be sure that you compile using the Multithreaded runtime, otherwise diff --git a/glx/glthread.h b/glx/glthread.h index e2765cebb..e7e2385c0 100644 --- a/glx/glthread.h +++ b/glx/glthread.h @@ -68,9 +68,7 @@ #define _glapi_Dispatch _mglapi_Dispatch #endif - - -#if (defined(PTHREADS) || defined(SOLARIS_THREADS) ||\ +#if (defined(PTHREADS) || \ defined(WIN32_THREADS) || defined(USE_XTHREADS) || defined(BEOS_THREADS)) \ && !defined(THREADS) # define THREADS @@ -127,27 +125,6 @@ typedef pthread_mutex_t _glthread_Mutex; * Be sure to compile with -mt on the Solaris compilers, or * use -D_REENTRANT if using gcc. */ -#ifdef SOLARIS_THREADS -#include <thread.h> - -typedef struct { - thread_key_t key; - mutex_t keylock; - int initMagic; -} _glthread_TSD; - -typedef thread_t _glthread_Thread; - -typedef mutex_t _glthread_Mutex; - -/* XXX need to really implement mutex-related macros */ -#define _glthread_DECLARE_STATIC_MUTEX(name) static _glthread_Mutex name = 0 -#define _glthread_INIT_MUTEX(name) (void) name -#define _glthread_DESTROY_MUTEX(name) (void) name -#define _glthread_LOCK_MUTEX(name) (void) name -#define _glthread_UNLOCK_MUTEX(name) (void) name - -#endif /* SOLARIS_THREADS */ |