glx: remove XTHREADS support

This commit is contained in:
RALOVICH, Kristóf 2009-07-23 17:58:08 +02:00 committed by Brian Paul
parent 27e55588e0
commit 8363dff251
3 changed files with 5 additions and 60 deletions

View file

@ -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)

View file

@ -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;

View file

@ -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();