summaryrefslogtreecommitdiff
path: root/src/egl/main/eglglobals.c
diff options
context:
space:
mode:
authorEmil Velikov <emil.l.velikov@gmail.com>2015-03-05 15:07:51 +0000
committerEmil Velikov <emil.l.velikov@gmail.com>2015-03-06 16:46:17 +0000
commit6cee785c69a5c8d2d32b6807f9c502117f5a74b0 (patch)
tree1359974cc2d2e3dd0da4ec7898f1f153bc3557d6 /src/egl/main/eglglobals.c
parentbfb4db83b618d57fcc5f0c9e9fdb3a7ff33d07f3 (diff)
egl/main: use c11/threads' mutex directly
Remove the inline wrappers/abstraction layer. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Diffstat (limited to 'src/egl/main/eglglobals.c')
-rw-r--r--src/egl/main/eglglobals.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/egl/main/eglglobals.c b/src/egl/main/eglglobals.c
index 56fe9e29d8..129bf29f1e 100644
--- a/src/egl/main/eglglobals.c
+++ b/src/egl/main/eglglobals.c
@@ -30,13 +30,14 @@
#include <stdlib.h>
#include <assert.h>
+#include "c11/threads.h"
+
#include "eglglobals.h"
#include "egldisplay.h"
#include "egldriver.h"
-#include "eglmutex.h"
-static _EGLMutex _eglGlobalMutex = _EGL_MUTEX_INITIALIZER;
+static mtx_t _eglGlobalMutex = _MTX_INITIALIZER_NP;
struct _egl_global _eglGlobal =
{
@@ -84,7 +85,7 @@ _eglAddAtExitCall(void (*func)(void))
if (func) {
static EGLBoolean registered = EGL_FALSE;
- _eglLockMutex(_eglGlobal.Mutex);
+ mtx_lock(_eglGlobal.Mutex);
if (!registered) {
atexit(_eglAtExit);
@@ -94,6 +95,6 @@ _eglAddAtExitCall(void (*func)(void))
assert(_eglGlobal.NumAtExitCalls < ARRAY_SIZE(_eglGlobal.AtExitCalls));
_eglGlobal.AtExitCalls[_eglGlobal.NumAtExitCalls++] = func;
- _eglUnlockMutex(_eglGlobal.Mutex);
+ mtx_unlock(_eglGlobal.Mutex);
}
}