From 99bcb1f06d35a038b9fcf9786938a31b3dba21b7 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Wed, 17 Feb 2010 17:29:52 +0800 Subject: egl: Add a mutex to _EGLDisplay. A display may be shared by multiple threads. Add a mutex for access control. --- src/egl/main/egldisplay.c | 1 + src/egl/main/egldisplay.h | 3 +++ 2 files changed, 4 insertions(+) (limited to 'src/egl/main') diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c index d7a8d142929..acf461def06 100644 --- a/src/egl/main/egldisplay.c +++ b/src/egl/main/egldisplay.c @@ -55,6 +55,7 @@ _eglNewDisplay(EGLNativeDisplayType nativeDisplay) { _EGLDisplay *dpy = (_EGLDisplay *) calloc(1, sizeof(_EGLDisplay)); if (dpy) { + _eglInitMutex(&dpy->Mutex); dpy->NativeDisplay = nativeDisplay; } return dpy; diff --git a/src/egl/main/egldisplay.h b/src/egl/main/egldisplay.h index 03903290fdd..36986464430 100644 --- a/src/egl/main/egldisplay.h +++ b/src/egl/main/egldisplay.h @@ -4,6 +4,7 @@ #include "egltypedefs.h" #include "egldefines.h" +#include "eglmutex.h" enum _egl_resource_type { @@ -53,6 +54,8 @@ struct _egl_display /* used to link displays */ _EGLDisplay *Next; + _EGLMutex Mutex; + EGLNativeDisplayType NativeDisplay; EGLBoolean Initialized; /**< True if the display is initialized */ -- cgit v1.2.3