summaryrefslogtreecommitdiffstats
path: root/src/egl/main/egllog.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/egl/main/egllog.c')
-rw-r--r--src/egl/main/egllog.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/egl/main/egllog.c b/src/egl/main/egllog.c
index babab07d8eb..1877d8bfd10 100644
--- a/src/egl/main/egllog.c
+++ b/src/egl/main/egllog.c
@@ -38,24 +38,24 @@
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
+#include "c11/threads.h"
#include "egllog.h"
#include "eglstring.h"
-#include "eglmutex.h"
#define MAXSTRING 1000
#define FALLBACK_LOG_LEVEL _EGL_WARNING
static struct {
- _EGLMutex mutex;
+ mtx_t mutex;
EGLBoolean initialized;
EGLint level;
_EGLLogProc logger;
EGLint num_messages;
} logging = {
- _EGL_MUTEX_INITIALIZER,
+ _MTX_INITIALIZER_NP,
EGL_FALSE,
FALLBACK_LOG_LEVEL,
NULL,
@@ -82,7 +82,7 @@ _eglSetLogProc(_EGLLogProc logger)
{
EGLint num_messages = 0;
- _eglLockMutex(&logging.mutex);
+ mtx_lock(&logging.mutex);
if (logging.logger != logger) {
logging.logger = logger;
@@ -91,7 +91,7 @@ _eglSetLogProc(_EGLLogProc logger)
logging.num_messages = 0;
}
- _eglUnlockMutex(&logging.mutex);
+ mtx_unlock(&logging.mutex);
if (num_messages)
_eglLog(_EGL_DEBUG,
@@ -111,9 +111,9 @@ _eglSetLogLevel(EGLint level)
case _EGL_WARNING:
case _EGL_INFO:
case _EGL_DEBUG:
- _eglLockMutex(&logging.mutex);
+ mtx_lock(&logging.mutex);
logging.level = level;
- _eglUnlockMutex(&logging.mutex);
+ mtx_unlock(&logging.mutex);
break;
default:
break;
@@ -188,7 +188,7 @@ _eglLog(EGLint level, const char *fmtStr, ...)
if (level > logging.level || level < 0)
return;
- _eglLockMutex(&logging.mutex);
+ mtx_lock(&logging.mutex);
if (logging.logger) {
va_start(args, fmtStr);
@@ -201,7 +201,7 @@ _eglLog(EGLint level, const char *fmtStr, ...)
logging.num_messages++;
}
- _eglUnlockMutex(&logging.mutex);
+ mtx_unlock(&logging.mutex);
if (level == _EGL_FATAL)
exit(1); /* or abort()? */