mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 09:48:07 +02:00
futex: disable futexes when compiling with tsan
Thread sanitizer doesn't support futexes, so don't use them in this case and fall back to standard mutexes. With that we can avoid tsan reporting a large number of false positives. v2: use #if instead of #ifdef to test the value of the define Signed-off-by: Gert Wollny <gert.wollny@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28650>
This commit is contained in:
parent
0d46e0e88b
commit
aa347029da
1 changed files with 4 additions and 0 deletions
|
|
@ -24,6 +24,9 @@
|
|||
#ifndef UTIL_FUTEX_H
|
||||
#define UTIL_FUTEX_H
|
||||
|
||||
#if THREAD_SANITIZER
|
||||
#define UTIL_FUTEX_SUPPORTED 0
|
||||
#else
|
||||
#if defined(HAVE_LINUX_FUTEX_H) && defined(__linux__)
|
||||
#define UTIL_FUTEX_SUPPORTED 1
|
||||
#elif defined(__FreeBSD__)
|
||||
|
|
@ -35,6 +38,7 @@
|
|||
#else
|
||||
#define UTIL_FUTEX_SUPPORTED 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if UTIL_FUTEX_SUPPORTED
|
||||
#include <stdint.h>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue