aboutsummaryrefslogtreecommitdiffstats
path: root/src/egl/main/egllog.c
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2015-03-06 17:07:40 +0000
committerEmil Velikov <[email protected]>2015-03-06 17:07:40 +0000
commit56ede80940751bfcdaf26e9c23e439d37ef0e96b (patch)
treeacb862412e11b809c5349c3fa66f541b0d17554e /src/egl/main/egllog.c
parenteb14d28e6db25eeecc89faf51837c92cc3dafbed (diff)
Revert "egl/main: use c11/threads' mutex directly"
This reverts commit 6cee785c69a5c8d2d32b6807f9c502117f5a74b0. Not meant to go in yet. Lacking review.
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 1877d8bfd10..babab07d8eb 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 {
- mtx_t mutex;
+ _EGLMutex mutex;
EGLBoolean initialized;
EGLint level;
_EGLLogProc logger;
EGLint num_messages;
} logging = {
- _MTX_INITIALIZER_NP,
+ _EGL_MUTEX_INITIALIZER,
EGL_FALSE,
FALLBACK_LOG_LEVEL,
NULL,
@@ -82,7 +82,7 @@ _eglSetLogProc(_EGLLogProc logger)
{
EGLint num_messages = 0;
- mtx_lock(&logging.mutex);
+ _eglLockMutex(&logging.mutex);
if (logging.logger != logger) {
logging.logger = logger;
@@ -91,7 +91,7 @@ _eglSetLogProc(_EGLLogProc logger)
logging.num_messages = 0;
}
- mtx_unlock(&logging.mutex);
+ _eglUnlockMutex(&logging.mutex);
if (num_messages)
_eglLog(_EGL_DEBUG,
@@ -111,9 +111,9 @@ _eglSetLogLevel(EGLint level)
case _EGL_WARNING:
case _EGL_INFO:
case _EGL_DEBUG:
- mtx_lock(&logging.mutex);
+ _eglLockMutex(&logging.mutex);
logging.level = level;
- mtx_unlock(&logging.mutex);
+ _eglUnlockMutex(&logging.mutex);
break;
default:
break;
@@ -188,7 +188,7 @@ _eglLog(EGLint level, const char *fmtStr, ...)
if (level > logging.level || level < 0)
return;
- mtx_lock(&logging.mutex);
+ _eglLockMutex(&logging.mutex);
if (logging.logger) {
va_start(args, fmtStr);
@@ -201,7 +201,7 @@ _eglLog(EGLint level, const char *fmtStr, ...)
logging.num_messages++;
}
- mtx_unlock(&logging.mutex);
+ _eglUnlockMutex(&logging.mutex);
if (level == _EGL_FATAL)
exit(1); /* or abort()? */