aboutsummaryrefslogtreecommitdiffstats
path: root/src/egl/main/eglcontext.c
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2009-07-17 11:41:02 -0600
committerBrian Paul <[email protected]>2009-07-17 11:41:02 -0600
commit75da80b29556e6dbbba21e5297ca440e475f65cb (patch)
tree8ae922d896d77df1e70768edaace6e12462d9bc4 /src/egl/main/eglcontext.c
parent8e92ec9fdd58bdfcdef65a995988974d3266b9ad (diff)
egl: Support per-thread info.
This commit introduces a "current" system to manage per-thread info. It uses TLS, if GLX_USE_TLS is defined, or pthread, if PTHREADS is defined. If none of them are defined, it uses a dummy implementation that is just like before. Signed-off-by: Chia-I Wu <[email protected]>
Diffstat (limited to 'src/egl/main/eglcontext.c')
-rw-r--r--src/egl/main/eglcontext.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/egl/main/eglcontext.c b/src/egl/main/eglcontext.c
index 461679db090..5e24b02a58d 100644
--- a/src/egl/main/eglcontext.c
+++ b/src/egl/main/eglcontext.c
@@ -109,17 +109,6 @@ _eglLookupContext(EGLContext ctx)
/**
- * Return the currently bound _EGLContext object, or NULL.
- */
-_EGLContext *
-_eglGetCurrentContext(void)
-{
- _EGLThreadInfo *t = _eglGetCurrentThread();
- return t->CurrentContext;
-}
-
-
-/**
* Just a placeholder/demo function. Real driver will never use this!
*/
EGLContext
@@ -219,6 +208,9 @@ _eglMakeCurrent(_EGLDriver *drv, EGLDisplay dpy, EGLSurface d,
_EGLSurface *oldDrawSurface = _eglGetCurrentSurface(EGL_DRAW);
_EGLSurface *oldReadSurface = _eglGetCurrentSurface(EGL_READ);
+ if (_eglIsCurrentThreadDummy())
+ return _eglError(EGL_BAD_ALLOC, "eglMakeCurrent");
+
/* error checking */
if (ctx) {
if (draw == NULL || read == NULL) {