diff options
Diffstat (limited to 'src/glx/glxcurrent.c')
-rw-r--r-- | src/glx/glxcurrent.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/glx/glxcurrent.c b/src/glx/glxcurrent.c index 7f47a427771..86fb658ca5e 100644 --- a/src/glx/glxcurrent.c +++ b/src/glx/glxcurrent.c @@ -33,7 +33,9 @@ * Client-side GLX interface for current context management. */ +#ifdef HAVE_PTHREAD #include <pthread.h> +#endif #include "glxclient.h" @@ -65,6 +67,8 @@ struct glx_context dummyContext = { * Current context management and locking */ +#if defined( HAVE_PTHREAD ) + _X_HIDDEN pthread_mutex_t __glXmutex = PTHREAD_MUTEX_INITIALIZER; # if defined( GLX_USE_TLS ) @@ -134,6 +138,13 @@ __glXGetCurrentContext(void) # endif /* defined( GLX_USE_TLS ) */ +#else + +/* not thread safe */ +_X_HIDDEN struct glx_context *__glXcurrentContext = &dummyContext; + +#endif + _X_HIDDEN void __glXSetCurrentContextNull(void) |