diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/glx/x11/glxclient.h | 14 | ||||
-rw-r--r-- | src/glx/x11/glxcurrent.c | 40 | ||||
-rw-r--r-- | src/glx/x11/glxext.c | 11 |
3 files changed, 5 insertions, 60 deletions
diff --git a/src/glx/x11/glxclient.h b/src/glx/x11/glxclient.h index bf68d0f8910..aff1c85fba1 100644 --- a/src/glx/x11/glxclient.h +++ b/src/glx/x11/glxclient.h @@ -55,9 +55,7 @@ #include "GL/internal/glcore.h" #include "glapi/glapitable.h" #include "glxhash.h" -#if defined( USE_XTHREADS ) -# include <X11/Xthreads.h> -#elif defined( PTHREADS ) +#if defined( PTHREADS ) # include <pthread.h> #endif @@ -623,7 +621,7 @@ extern void __glXPreferEGL(int state); extern int __glXDebug; /* This is per-thread storage in an MT environment */ -#if defined( USE_XTHREADS ) || defined( PTHREADS ) +#if defined( PTHREADS ) extern void __glXSetCurrentContext(__GLXcontext *c); @@ -646,7 +644,7 @@ extern __GLXcontext *__glXcurrentContext; #define __glXGetCurrentContext() __glXcurrentContext #define __glXSetCurrentContext(gc) __glXcurrentContext = gc -#endif /* defined( USE_XTHREADS ) || defined( PTHREADS ) */ +#endif /* defined( PTHREADS ) */ extern void __glXSetCurrentContextNull(void); @@ -657,11 +655,7 @@ extern void __glXFreeContext(__GLXcontext*); ** Global lock for all threads in this address space using the GLX ** extension */ -#if defined( USE_XTHREADS ) -extern xmutex_rec __glXmutex; -#define __glXLock() xmutex_lock(&__glXmutex) -#define __glXUnlock() xmutex_unlock(&__glXmutex) -#elif defined( PTHREADS ) +#if defined( PTHREADS ) extern pthread_mutex_t __glXmutex; #define __glXLock() pthread_mutex_lock(&__glXmutex) #define __glXUnlock() pthread_mutex_unlock(&__glXmutex) diff --git a/src/glx/x11/glxcurrent.c b/src/glx/x11/glxcurrent.c index d44e0dd1fc8..ce037e0ef41 100644 --- a/src/glx/x11/glxcurrent.c +++ b/src/glx/x11/glxcurrent.c @@ -73,45 +73,7 @@ static __GLapi *IndirectAPI = NULL; * Current context management and locking */ -#if defined( USE_XTHREADS ) - -/* thread safe */ -static GLboolean TSDinitialized = GL_FALSE; -static xthread_key_t ContextTSD; - -_X_HIDDEN __GLXcontext * -__glXGetCurrentContext(void) -{ - if (!TSDinitialized) { - xthread_key_create(&ContextTSD, NULL); - TSDinitialized = GL_TRUE; - return &dummyContext; - } - else { - void *p; - xthread_get_specific(ContextTSD, &p); - if (!p) - return &dummyContext; - else - return (__GLXcontext *) p; - } -} - -_X_HIDDEN void -__glXSetCurrentContext(__GLXcontext * c) -{ - if (!TSDinitialized) { - xthread_key_create(&ContextTSD, NULL); - TSDinitialized = GL_TRUE; - } - xthread_set_specific(ContextTSD, c); -} - - -/* Used by the __glXLock() and __glXUnlock() macros */ -_X_HIDDEN xmutex_rec __glXmutex; - -#elif defined( PTHREADS ) +#if defined( PTHREADS ) _X_HIDDEN pthread_mutex_t __glXmutex = PTHREAD_MUTEX_INITIALIZER; diff --git a/src/glx/x11/glxext.c b/src/glx/x11/glxext.c index b296b7c651c..e07ed29790c 100644 --- a/src/glx/x11/glxext.c +++ b/src/glx/x11/glxext.c @@ -646,17 +646,6 @@ __glXInitialize(Display * dpy) Bool glx_direct, glx_accel; #endif -#if defined(USE_XTHREADS) - { - static int firstCall = 1; - if (firstCall) { - /* initialize the GLX mutexes */ - xmutex_init(&__glXmutex); - firstCall = 0; - } - } -#endif - /* The one and only long long lock */ __glXLock(); |