diff options
author | Emil Velikov <[email protected]> | 2015-03-05 15:07:51 +0000 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2015-03-06 16:46:17 +0000 |
commit | 6cee785c69a5c8d2d32b6807f9c502117f5a74b0 (patch) | |
tree | 1359974cc2d2e3dd0da4ec7898f1f153bc3557d6 /src/egl/main/egllog.c | |
parent | bfb4db83b618d57fcc5f0c9e9fdb3a7ff33d07f3 (diff) |
egl/main: use c11/threads' mutex directly
Remove the inline wrappers/abstraction layer.
Signed-off-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/egl/main/egllog.c')
-rw-r--r-- | src/egl/main/egllog.c | 18 |
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()? */ |