diff options
author | Emil Velikov <[email protected]> | 2015-03-05 15:07:51 +0000 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2015-03-06 16:46:17 +0000 |
commit | 6cee785c69a5c8d2d32b6807f9c502117f5a74b0 (patch) | |
tree | 1359974cc2d2e3dd0da4ec7898f1f153bc3557d6 /src/egl/main/egldisplay.c | |
parent | bfb4db83b618d57fcc5f0c9e9fdb3a7ff33d07f3 (diff) |
egl/main: use c11/threads' mutex directly
Remove the inline wrappers/abstraction layer.
Signed-off-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/egl/main/egldisplay.c')
-rw-r--r-- | src/egl/main/egldisplay.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c index a167ae5c738..b7a5b8fb9d9 100644 --- a/src/egl/main/egldisplay.c +++ b/src/egl/main/egldisplay.c @@ -35,13 +35,14 @@ #include <assert.h> #include <stdlib.h> #include <string.h> +#include "c11/threads.h" + #include "eglcontext.h" #include "eglcurrent.h" #include "eglsurface.h" #include "egldisplay.h" #include "egldriver.h" #include "eglglobals.h" -#include "eglmutex.h" #include "egllog.h" /* Includes for _eglNativePlatformDetectNativeDisplay */ @@ -260,7 +261,7 @@ _eglFindDisplay(_EGLPlatformType plat, void *plat_dpy) if (plat == _EGL_INVALID_PLATFORM) return NULL; - _eglLockMutex(_eglGlobal.Mutex); + mtx_lock(_eglGlobal.Mutex); /* search the display list first */ dpy = _eglGlobal.DisplayList; @@ -274,7 +275,7 @@ _eglFindDisplay(_EGLPlatformType plat, void *plat_dpy) if (!dpy) { dpy = calloc(1, sizeof(_EGLDisplay)); if (dpy) { - _eglInitMutex(&dpy->Mutex); + mtx_init(&dpy->Mutex, mtx_plain); dpy->Platform = plat; dpy->PlatformDisplay = plat_dpy; @@ -284,7 +285,7 @@ _eglFindDisplay(_EGLPlatformType plat, void *plat_dpy) } } - _eglUnlockMutex(_eglGlobal.Mutex); + mtx_unlock(_eglGlobal.Mutex); return dpy; } @@ -344,14 +345,14 @@ _eglCheckDisplayHandle(EGLDisplay dpy) { _EGLDisplay *cur; - _eglLockMutex(_eglGlobal.Mutex); + mtx_lock(_eglGlobal.Mutex); cur = _eglGlobal.DisplayList; while (cur) { if (cur == (_EGLDisplay *) dpy) break; cur = cur->Next; } - _eglUnlockMutex(_eglGlobal.Mutex); + mtx_unlock(_eglGlobal.Mutex); return (cur != NULL); } |