egl: Add a mutex to _EGLDisplay.
authorChia-I Wu <olv@lunarg.com>
Wed, 17 Feb 2010 09:29:52 +0000 (17:29 +0800)
committerChia-I Wu <olv@lunarg.com>
Wed, 17 Feb 2010 12:00:11 +0000 (20:00 +0800)
A display may be shared by multiple threads.  Add a mutex for access
control.

src/egl/main/egldisplay.c
src/egl/main/egldisplay.h

index d7a8d14..acf461d 100644 (file)
@@ -55,6 +55,7 @@ _eglNewDisplay(EGLNativeDisplayType nativeDisplay)
 {
    _EGLDisplay *dpy = (_EGLDisplay *) calloc(1, sizeof(_EGLDisplay));
    if (dpy) {
+      _eglInitMutex(&dpy->Mutex);
       dpy->NativeDisplay = nativeDisplay;
    }
    return dpy;
index 0390329..3698646 100644 (file)
@@ -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 */