#include <string.h>
#include <stdio.h>
#include <stdlib.h>
+#include "c11/threads.h"
#include "eglstring.h"
#include "egldefines.h"
#include "egldisplay.h"
#include "egldriver.h"
#include "egllog.h"
-#include "eglmutex.h"
#if defined(_EGL_OS_UNIX)
#include <dlfcn.h>
_EGLDriver *Driver;
} _EGLModule;
-static _EGLMutex _eglModuleMutex = _EGL_MUTEX_INITIALIZER;
+static mtx_t _eglModuleMutex = _MTX_INITIALIZER_NP;
static _EGLArray *_eglModules;
const struct {
assert(!dpy->Initialized);
- _eglLockMutex(&_eglModuleMutex);
+ mtx_lock(&_eglModuleMutex);
/* set options */
dpy->Options.TestOnly = test_only;
best_drv = _eglMatchAndInitialize(dpy);
}
- _eglUnlockMutex(&_eglModuleMutex);
+ mtx_unlock(&_eglModuleMutex);
if (best_drv) {
_eglLog(_EGL_DEBUG, "the best driver is %s%s",