summaryrefslogtreecommitdiffstats
path: root/src/egl/main/egllog.c
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2015-03-06 16:54:55 +0000
committerEmil Velikov <[email protected]>2015-03-11 23:28:25 +0000
commitefe87f1a801c61d087cd2b29a2c150453241c3d4 (patch)
treed7decbfd791f6ee4ab728d10f8573984a4bad4ee /src/egl/main/egllog.c
parent90e50908d7f080d91f41d889cfe0dc67134971eb (diff)
egl/main: use c11/threads' mutex directly
Remove the inline wrappers/abstraction layer. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Brian Paul <[email protected]>
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()? */