summaryrefslogtreecommitdiffstats
path: root/src/mesa/glapi/glthread.h
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2005-04-13 20:59:15 +0000
committerIan Romanick <[email protected]>2005-04-13 20:59:15 +0000
commit25fe93f0a11e6f4c8d470441ff91b9cddf7b3023 (patch)
treefc8e2b7c9509abef30425ecf49aebaf281614a6f /src/mesa/glapi/glthread.h
parentc604e457d1ebe9a884b0a1fb08af38a0ce486699 (diff)
Add TLS support to libGL and, by virtue of using glthread.h and GL_CALL, all
DRI drivers. A TLS enabled libGL can load a TLS or a non-TLS DRI driver, but a TLS DRI driver requires a TLS enabled libGL. This fixes bug #1822.
Diffstat (limited to 'src/mesa/glapi/glthread.h')
-rw-r--r--src/mesa/glapi/glthread.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mesa/glapi/glthread.h b/src/mesa/glapi/glthread.h
index 1d2a4a7b003..615d169986d 100644
--- a/src/mesa/glapi/glthread.h
+++ b/src/mesa/glapi/glthread.h
@@ -306,7 +306,14 @@ _glthread_GetTSD(_glthread_TSD *);
extern void
_glthread_SetTSD(_glthread_TSD *, void *);
-#ifndef GL_CALL
+#if defined(GLX_USE_TLS)
+
+extern __thread struct _glapi_table * _glapi_tls_Dispatch
+ __attribute__((tls_model("initial-exec")));
+
+# define GL_CALL(name) (*(_glapi_tls_Dispatch-> name))
+
+#elif !defined(GL_CALL)
# if defined(THREADS)
extern struct _glapi_table * _glapi_DispatchTSD;
# define GL_CALL(name) \