egl: Kill macro _EGL_DECLARE_MUTEX
authorChad Versace <chad.versace@linux.intel.com>
Fri, 11 Oct 2013 19:50:21 +0000 (12:50 -0700)
committerChad Versace <chad.versace@linux.intel.com>
Tue, 26 Nov 2013 20:50:30 +0000 (12:50 -0800)
Replace all occurences of the macro with its expansion.

It seems that the macro intended to provide cross-platform static mutex
intialization. However, it had the same definition in all pre-processor
paths:
    #define _EGL_DECLARE_MUTEX(m) _EGLMutex m = _EGL_MUTEX_INITIALIZER

Therefore this abstraction obscured rather than helped.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/egl/main/eglcurrent.c
src/egl/main/egldriver.c
src/egl/main/eglglobals.c
src/egl/main/eglmutex.h
src/egl/main/eglscreen.c

index 5b09a48077247180d417b9be5de4f9af5f35762a..fcb732d498452de625a5d367d7ef00e24a9ac312 100644 (file)
@@ -45,7 +45,7 @@ static _EGLThreadInfo dummy_thread = _EGL_THREAD_INFO_INITIALIZER;
 #if HAVE_PTHREAD
 #include <pthread.h>
 
-static _EGL_DECLARE_MUTEX(_egl_TSDMutex);
+static _EGLMutex _egl_TSDMutex = _EGL_MUTEX_INITIALIZER;
 static EGLBoolean _egl_TSDInitialized;
 static pthread_key_t _egl_TSD;
 static void (*_egl_FreeTSD)(_EGLThreadInfo *);
index ffdd146284640df3cf080855e58d210f69fb2748..6b6792a0967143c824d8f42c015998831c53d3ba 100644 (file)
@@ -60,7 +60,7 @@ typedef struct _egl_module {
    _EGLDriver *Driver;
 } _EGLModule;
 
-static _EGL_DECLARE_MUTEX(_eglModuleMutex);
+static _EGLMutex _eglModuleMutex = _EGL_MUTEX_INITIALIZER;
 static _EGLArray *_eglModules;
 
 const struct {
index 5c2fddfbf9ee9420c1df57d5f78373fcde2af405..cc06268178fd05c32a8aa9f6efb1407306396a91 100644 (file)
@@ -36,7 +36,8 @@
 #include "eglmutex.h"
 
 
-static _EGL_DECLARE_MUTEX(_eglGlobalMutex);
+static _EGLMutex _eglGlobalMutex = _EGL_MUTEX_INITIALIZER;
+
 struct _egl_global _eglGlobal =
 {
    &_eglGlobalMutex,       /* Mutex */
index e46486463b160b6be5e8ec8413fb53610c9928f8..1349e9ec78a0f5783df731cec2e83c341d0c2b18 100644 (file)
@@ -60,8 +60,6 @@ _eglUnlockMutex(_EGLMutex *m)
 }
 
 #define _EGL_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
-#define _EGL_DECLARE_MUTEX(m) \
-   _EGLMutex m = _EGL_MUTEX_INITIALIZER
 
 #else
 
@@ -72,8 +70,6 @@ static INLINE void _eglLockMutex(_EGLMutex *m) { (void) m; }
 static INLINE void _eglUnlockMutex(_EGLMutex *m) { (void) m; }
 
 #define _EGL_MUTEX_INITIALIZER 0
-#define _EGL_DECLARE_MUTEX(m) \
-   _EGLMutex m = _EGL_MUTEX_INITIALIZER
 
 #endif
 
index 21e245006e3bcbccd59a2d4bde4e52f04e636280..46cfebba205b56479198d6f04d39f910ebf0b80f 100644 (file)
@@ -57,7 +57,7 @@
 
 
 /* ugh, no atomic op? */
-static _EGL_DECLARE_MUTEX(_eglNextScreenHandleMutex);
+static _EGLMutex _eglNextScreenHandleMutex = _EGL_MUTEX_INITIALIZER;
 static EGLScreenMESA _eglNextScreenHandle = 1;