glx: remove support for non-multithreaded platforms
Implicitly required for a while, although commit 9385c592c6
(mapi:
remove u_thread.h) was the one that put the final nail on the
coffin.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
This commit is contained in:
parent
8b15a883e0
commit
38591295cd
|
@ -185,8 +185,6 @@ ways that the dispatch table pointer can be accessed. There are four
|
||||||
different methods that can be used:</p>
|
different methods that can be used:</p>
|
||||||
|
|
||||||
<ol>
|
<ol>
|
||||||
<li>Using <tt>_glapi_Dispatch</tt> directly in builds for non-multithreaded
|
|
||||||
environments.</li>
|
|
||||||
<li>Using <tt>_glapi_Dispatch</tt> and <tt>_glapi_get_dispatch</tt> in
|
<li>Using <tt>_glapi_Dispatch</tt> and <tt>_glapi_get_dispatch</tt> in
|
||||||
multithreaded environments.</li>
|
multithreaded environments.</li>
|
||||||
<li>Using <tt>_glapi_Dispatch</tt> and <tt>pthread_getspecific</tt> in
|
<li>Using <tt>_glapi_Dispatch</tt> and <tt>pthread_getspecific</tt> in
|
||||||
|
@ -204,9 +202,8 @@ terribly relevant.</p>
|
||||||
few preprocessor defines.</p>
|
few preprocessor defines.</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>If <tt>GLX_USE_TLS</tt> is defined, method #4 is used.</li>
|
<li>If <tt>GLX_USE_TLS</tt> is defined, method #3 is used.</li>
|
||||||
<li>If <tt>HAVE_PTHREAD</tt> is defined, method #3 is used.</li>
|
<li>If <tt>HAVE_PTHREAD</tt> is defined, method #2 is used.</li>
|
||||||
<li>If <tt>WIN32_THREADS</tt> is defined, method #2 is used.</li>
|
|
||||||
<li>If none of the preceding are defined, method #1 is used.</li>
|
<li>If none of the preceding are defined, method #1 is used.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
|
@ -47,15 +47,13 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <pthread.h>
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#endif
|
#endif
|
||||||
#include "GL/glxproto.h"
|
#include "GL/glxproto.h"
|
||||||
#include "glxconfig.h"
|
#include "glxconfig.h"
|
||||||
#include "glxhash.h"
|
#include "glxhash.h"
|
||||||
#if defined( HAVE_PTHREAD )
|
|
||||||
# include <pthread.h>
|
|
||||||
#endif
|
|
||||||
#include "util/macros.h"
|
#include "util/macros.h"
|
||||||
|
|
||||||
#include "glxextensions.h"
|
#include "glxextensions.h"
|
||||||
|
@ -631,7 +629,6 @@ extern void __glXPreferEGL(int state);
|
||||||
extern int __glXDebug;
|
extern int __glXDebug;
|
||||||
|
|
||||||
/* This is per-thread storage in an MT environment */
|
/* This is per-thread storage in an MT environment */
|
||||||
#if defined( HAVE_PTHREAD )
|
|
||||||
|
|
||||||
extern void __glXSetCurrentContext(struct glx_context * c);
|
extern void __glXSetCurrentContext(struct glx_context * c);
|
||||||
|
|
||||||
|
@ -648,14 +645,6 @@ extern struct glx_context *__glXGetCurrentContext(void);
|
||||||
|
|
||||||
# endif /* defined( GLX_USE_TLS ) */
|
# endif /* defined( GLX_USE_TLS ) */
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
extern struct glx_context *__glXcurrentContext;
|
|
||||||
#define __glXGetCurrentContext() __glXcurrentContext
|
|
||||||
#define __glXSetCurrentContext(gc) __glXcurrentContext = gc
|
|
||||||
|
|
||||||
#endif /* defined( HAVE_PTHREAD ) */
|
|
||||||
|
|
||||||
extern void __glXSetCurrentContextNull(void);
|
extern void __glXSetCurrentContextNull(void);
|
||||||
|
|
||||||
|
|
||||||
|
@ -663,14 +652,9 @@ extern void __glXSetCurrentContextNull(void);
|
||||||
** Global lock for all threads in this address space using the GLX
|
** Global lock for all threads in this address space using the GLX
|
||||||
** extension
|
** extension
|
||||||
*/
|
*/
|
||||||
#if defined( HAVE_PTHREAD )
|
|
||||||
extern pthread_mutex_t __glXmutex;
|
extern pthread_mutex_t __glXmutex;
|
||||||
#define __glXLock() pthread_mutex_lock(&__glXmutex)
|
#define __glXLock() pthread_mutex_lock(&__glXmutex)
|
||||||
#define __glXUnlock() pthread_mutex_unlock(&__glXmutex)
|
#define __glXUnlock() pthread_mutex_unlock(&__glXmutex)
|
||||||
#else
|
|
||||||
#define __glXLock()
|
|
||||||
#define __glXUnlock()
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Setup for a command. Initialize the extension for dpy if necessary.
|
** Setup for a command. Initialize the extension for dpy if necessary.
|
||||||
|
|
|
@ -33,9 +33,7 @@
|
||||||
* Client-side GLX interface for current context management.
|
* Client-side GLX interface for current context management.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_PTHREAD
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "glxclient.h"
|
#include "glxclient.h"
|
||||||
|
|
||||||
|
@ -67,8 +65,6 @@ struct glx_context dummyContext = {
|
||||||
* Current context management and locking
|
* Current context management and locking
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined( HAVE_PTHREAD )
|
|
||||||
|
|
||||||
_X_HIDDEN pthread_mutex_t __glXmutex = PTHREAD_MUTEX_INITIALIZER;
|
_X_HIDDEN pthread_mutex_t __glXmutex = PTHREAD_MUTEX_INITIALIZER;
|
||||||
|
|
||||||
# if defined( GLX_USE_TLS )
|
# if defined( GLX_USE_TLS )
|
||||||
|
@ -138,13 +134,6 @@ __glXGetCurrentContext(void)
|
||||||
|
|
||||||
# endif /* defined( GLX_USE_TLS ) */
|
# endif /* defined( GLX_USE_TLS ) */
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
/* not thread safe */
|
|
||||||
_X_HIDDEN struct glx_context *__glXcurrentContext = &dummyContext;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
_X_HIDDEN void
|
_X_HIDDEN void
|
||||||
__glXSetCurrentContextNull(void)
|
__glXSetCurrentContextNull(void)
|
||||||
|
|
|
@ -77,7 +77,7 @@ indirect_create_context_attribs(struct glx_screen *base,
|
||||||
|
|
||||||
__thread void *__glX_tls_Context = NULL;
|
__thread void *__glX_tls_Context = NULL;
|
||||||
|
|
||||||
#if defined(HAVE_PTHREAD) && !defined(GLX_USE_TLS)
|
#if !defined(GLX_USE_TLS)
|
||||||
extern "C" struct glx_context *
|
extern "C" struct glx_context *
|
||||||
__glXGetCurrentContext()
|
__glXGetCurrentContext()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue