mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
egl: Remove the need of _MTX_INITIALIZER_NP by using simple_mtx_t/SIMPLE_MTX_INITIALIZER in egllog.c
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Acked-by: David Heidelberg <david.heidelberg@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18493>
This commit is contained in:
parent
23e6a4ccda
commit
37d79e38e9
1 changed files with 5 additions and 4 deletions
|
|
@ -41,6 +41,7 @@
|
|||
#include <string.h>
|
||||
#include "c11/threads.h"
|
||||
#include "util/macros.h"
|
||||
#include "util/simple_mtx.h"
|
||||
#include "util/u_string.h"
|
||||
|
||||
#include "egllog.h"
|
||||
|
|
@ -60,12 +61,12 @@
|
|||
|
||||
|
||||
static struct {
|
||||
mtx_t mutex;
|
||||
simple_mtx_t mutex;
|
||||
|
||||
EGLBoolean initialized;
|
||||
EGLint level;
|
||||
} logging = {
|
||||
.mutex = _MTX_INITIALIZER_NP,
|
||||
.mutex = SIMPLE_MTX_INITIALIZER,
|
||||
.initialized = EGL_FALSE,
|
||||
.level = FALLBACK_LOG_LEVEL,
|
||||
};
|
||||
|
|
@ -160,7 +161,7 @@ _eglLog(EGLint level, const char *fmtStr, ...)
|
|||
if (level > logging.level || level < 0)
|
||||
return;
|
||||
|
||||
mtx_lock(&logging.mutex);
|
||||
simple_mtx_lock(&logging.mutex);
|
||||
|
||||
va_start(args, fmtStr);
|
||||
ret = vsnprintf(msg, MAXSTRING, fmtStr, args);
|
||||
|
|
@ -170,7 +171,7 @@ _eglLog(EGLint level, const char *fmtStr, ...)
|
|||
|
||||
_eglDefaultLogger(level, msg);
|
||||
|
||||
mtx_unlock(&logging.mutex);
|
||||
simple_mtx_unlock(&logging.mutex);
|
||||
|
||||
if (level == _EGL_FATAL)
|
||||
exit(1); /* or abort()? */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue