summaryrefslogtreecommitdiffstats
path: root/src/glx/glxcurrent.c
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2015-03-06 17:07:11 +0000
committerEmil Velikov <[email protected]>2015-03-06 17:07:11 +0000
commit5e3276f5c7bf1a363de710709737624634389858 (patch)
tree300eb22296bdd3c4a25213f89a5bee330f473c71 /src/glx/glxcurrent.c
parent1c1fd82b4b50fae4644e442b0c2a017f1e428610 (diff)
Revert "glx: remove support for non-multithreaded platforms"
This reverts commit 38591295cd4b68f89f257b20f476f98de3772a47. Not meant to go in yet. Lacking review.
Diffstat (limited to 'src/glx/glxcurrent.c')
-rw-r--r--src/glx/glxcurrent.c11
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)