summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/xlib/glxapi.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-08-26 16:35:12 -0600
committerBrian Paul <[email protected]>2008-08-26 16:35:12 -0600
commit0bb852fa49e7f9a31036089ea4f5dfbd312a4a3a (patch)
tree7f93ecd62f156d5c94b176cd7e4f083823051f67 /src/gallium/winsys/xlib/glxapi.c
parentb5ab3b7dfc42a568a156dec2fa043292014f98a7 (diff)
gallium: thread wrapper clean-up
In p_thread.h replace _glthread_* functions with new pipe_* functions. Remove other old cruft.
Diffstat (limited to 'src/gallium/winsys/xlib/glxapi.c')
-rw-r--r--src/gallium/winsys/xlib/glxapi.c26
1 files changed, 4 insertions, 22 deletions
diff --git a/src/gallium/winsys/xlib/glxapi.c b/src/gallium/winsys/xlib/glxapi.c
index c2ccce6f520..c059fc3edb5 100644
--- a/src/gallium/winsys/xlib/glxapi.c
+++ b/src/gallium/winsys/xlib/glxapi.c
@@ -37,6 +37,7 @@
#include "main/glheader.h"
#include "glapi/glapi.h"
#include "glxapi.h"
+#include "pipe/p_thread.h"
extern struct _glxapi_table *_real_GetGLXDispatchTable(void);
@@ -127,26 +128,13 @@ get_dispatch(Display *dpy)
/**
* GLX API current context.
*/
-#if defined(GLX_USE_TLS)
-PUBLIC __thread void * CurrentContext
- __attribute__((tls_model("initial-exec")));
-#elif defined(THREADS)
-static _glthread_TSD ContextTSD; /**< Per-thread context pointer */
-#else
-static GLXContext CurrentContext = 0;
-#endif
+pipe_tsd ContextTSD;
static void
SetCurrentContext(GLXContext c)
{
-#if defined(GLX_USE_TLS)
- CurrentContext = c;
-#elif defined(THREADS)
- _glthread_SetTSD(&ContextTSD, c);
-#else
- CurrentContext = c;
-#endif
+ pipe_tsd_set(&ContextTSD, c);
}
@@ -238,13 +226,7 @@ glXGetConfig(Display *dpy, XVisualInfo *visinfo, int attrib, int *value)
GLXContext PUBLIC
glXGetCurrentContext(void)
{
-#if defined(GLX_USE_TLS)
- return CurrentContext;
-#elif defined(THREADS)
- return (GLXContext) _glthread_GetTSD(&ContextTSD);
-#else
- return CurrentContext;
-#endif
+ return (GLXContext) pipe_tsd_get(&ContextTSD);
}