nir: Remove the need of _MTX_INITIALIZER_NP by using simple_mtx_t/SIMPLE_MTX_INITIALIZER in nir/nir_validate.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:
Yonggang Luo
2022-09-06 23:05:39 +08:00
committed by Marge Bot
parent e518ff4fd5
commit 23e6a4ccda

View File

@@ -28,6 +28,7 @@
#include "nir.h"
#include "nir_xfb_info.h"
#include "c11/threads.h"
#include "util/simple_mtx.h"
#include <assert.h>
/*
@@ -1733,7 +1734,7 @@ destroy_validate_state(validate_state *state)
ralloc_free(state->mem_ctx);
}
mtx_t fail_dump_mutex = _MTX_INITIALIZER_NP;
simple_mtx_t fail_dump_mutex = SIMPLE_MTX_INITIALIZER;
static void
dump_errors(validate_state *state, const char *when)
@@ -1743,7 +1744,7 @@ dump_errors(validate_state *state, const char *when)
/* Lock around dumping so that we get clean dumps in a multi-threaded
* scenario
*/
mtx_lock(&fail_dump_mutex);
simple_mtx_lock(&fail_dump_mutex);
if (when) {
fprintf(stderr, "NIR validation failed %s\n", when);
@@ -1763,7 +1764,7 @@ dump_errors(validate_state *state, const char *when)
}
}
mtx_unlock(&fail_dump_mutex);
simple_mtx_unlock(&fail_dump_mutex);
abort();
}