egl/main: use c11/threads' mutex directly
Remove the inline wrappers/abstraction layer. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user