util: cleanup os_thread.h

__pipe_mutex_assert_locked is not used anymore so remove it from os_thread.h
The remove of "pipe/p_compiler.h" caused compiling failure also fixed

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19557>
This commit is contained in:
Yonggang Luo
2022-11-06 20:52:26 +08:00
committed by Marge Bot
parent 1129537e4c
commit a72d57fe26
2 changed files with 1 additions and 23 deletions

View File

@@ -36,29 +36,6 @@
#ifndef OS_THREAD_H_
#define OS_THREAD_H_
#include "pipe/p_compiler.h"
#include "util/u_debug.h" /* for assert */
#include "util/u_thread.h"
#define pipe_mutex_assert_locked(mutex) \
__pipe_mutex_assert_locked(&(mutex))
static inline void
__pipe_mutex_assert_locked(mtx_t *mutex)
{
#ifdef DEBUG
/* NOTE: this would not work for recursive mutexes, but
* mtx_t doesn't support those
*/
int ret = mtx_trylock(mutex);
assert(ret == thrd_busy);
if (ret == thrd_success)
mtx_unlock(mutex);
#else
(void)mutex;
#endif
}
#endif /* OS_THREAD_H_ */

View File

@@ -41,6 +41,7 @@
#include "xm_api.h"
#include "main/errors.h"
#include "main/config.h"
#include "pipe/p_compiler.h"
#include "util/u_math.h"
#include "util/u_memory.h"