Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
#include "util/u_thread.h"
-static inline int pipe_thread_is_self( thrd_t thread )
-{
-#if defined(HAVE_PTHREAD)
-# if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && defined(__GLIBC_MINOR__) && \
- (__GLIBC__ >= 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12))
- return pthread_equal(pthread_self(), thread);
-# endif
-#endif
- return 0;
-}
-
#define pipe_mutex_assert_locked(mutex) \
__pipe_mutex_assert_locked(&(mutex))
if (!device->csmt_active)
return device->context.pipe;
- if (!pipe_thread_is_self(ctx->worker))
+ if (!u_thread_is_self(ctx->worker))
nine_csmt_process(device);
return device->context.pipe;
#define U_THREAD_H_
#include <stdint.h>
+#include <stdbool.h>
#include "c11/threads.h"
#endif
}
+static inline bool u_thread_is_self(thrd_t thread)
+{
+#if defined(HAVE_PTHREAD)
+# if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && defined(__GLIBC_MINOR__) && \
+ (__GLIBC__ >= 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12))
+ return pthread_equal(pthread_self(), thread);
+# endif
+#endif
+ return false;
+}
+
#endif /* U_THREAD_H_ */