From 25fe93f0a11e6f4c8d470441ff91b9cddf7b3023 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 13 Apr 2005 20:59:15 +0000 Subject: 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. --- src/mesa/glapi/glthread.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/mesa/glapi/glthread.h') 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) \ -- cgit v1.2.3