mesa/src/util
Samuel Pitoiset 04c90f292e util/queue: fix a data race detected by TSAN when finishing the queue
Thread sanitizer complains if it detects that the pthread_barrier
is destroyed when a thread might still blocked on the barrier.

Fix this by destroying the barrier only if pthread_barrier_wait
returns PTHREAD_BARRIER_SERIAL_THREAD which is the value for success.

In practice this shouldn't fix anything serious given that this code
is only called when the disk cache is destroyed.

Original patch from Timothy Arceri.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4342
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13861>
2021-11-19 09:02:23 +01:00
..
format util/format: Add G8_B8R8_420_UNORM to match Vulkan. 2021-11-11 00:10:57 +00:00
indices move util/indices to core util 2021-11-16 14:12:03 +00:00
perf util/u_trace: Replace Flag with IntEnum to support python3.5 2021-11-05 11:54:30 +00:00
sha1 util: rename PIPE_ARCH_*_ENDIAN to UTIL_ARCH_*_ENDIAN 2019-11-05 16:39:55 +00:00
tests util/dag: Add dag_add_edge_max_data 2021-11-17 13:41:47 +00:00
00-mesa-defaults.conf glx: add a workaround to glXDestroyWindow for Viewperf2020/Sw 2021-11-17 21:26:54 +00:00
anon_file.c util: use anonymous file for memory fd creation 2021-10-27 15:26:52 +00:00
anon_file.h util/anon_file: const string param 2019-08-08 22:02:54 +01:00
bigmath.h
bitscan.c util: only allow _BitScanReverse64 on 64-bit cpus 2019-09-02 12:45:45 +00:00
bitscan.h util: add a util_bitcount variant that selects POPCNT through C++ template arg 2021-11-03 23:22:31 +00:00
bitset.h util/bitset: add BITSET_SET_RANGE(..) 2021-09-21 20:25:31 +00:00
blob.c util: stop including files from mesa/main 2020-03-27 21:00:09 +00:00
blob.h util/blob: Add overwrite function for uint8 2020-03-20 17:25:25 +00:00
build_id.c
build_id.h util: add missing extern C 2020-09-25 20:09:08 +00:00
cnd_monotonic.h c11/threads: Re-align return values for timed waits 2021-11-16 10:02:08 -06:00
compiler.h util: Add support for clang::fallthrough. 2021-11-09 20:51:14 +00:00
compress.c meson, util: Make zlib optional again 2021-03-19 19:33:59 +00:00
compress.h meson, util: Make zlib optional again 2021-03-19 19:33:59 +00:00
crc32.c
crc32.h
dag.c util/dag: Add dag_add_edge_max_data 2021-11-17 13:41:47 +00:00
dag.h util/dag: Add dag_add_edge_max_data 2021-11-17 13:41:47 +00:00
debug.c util: stop including files from mesa/main 2020-03-27 21:00:09 +00:00
debug.h Revert "util: Add helpers for various one-time-init patters" 2020-11-25 09:44:11 +00:00
detect_os.h util: introduce detect_os.h 2019-08-02 18:38:52 +01:00
disk_cache.c disk_cache: use UTIL_QUEUE_INIT_SCALE_THREADS 2021-06-17 09:11:59 +02:00
disk_cache.h util/disk_cache: add nocopy variant of disk cache store function 2021-06-11 03:09:22 +00:00
disk_cache_os.c util/disk_cache: Don't leak when cache is empty 2021-07-02 01:54:10 +00:00
disk_cache_os.h util/disk_cache: make MESA_DISK_CACHE_READ_ONLY_FOZ_DBS a relative path 2021-03-04 04:07:46 +00:00
double.c util: add fp64 -> fp32 conversion support for RTNE and RTZ rounding modes 2019-09-17 23:39:18 +03:00
double.h util: add fp64 -> fp32 conversion support for RTNE and RTZ rounding modes 2019-09-17 23:39:18 +03:00
driconf.h glx: add a workaround to glXDestroyWindow for Viewperf2020/Sw 2021-11-17 21:26:54 +00:00
driconf_static.py Fix building AMD MM/GL with EL7 2021-08-27 19:05:25 +00:00
enum_operators.h util: tune signatures of generated enum operators 2021-05-14 11:00:52 +00:00
fast_idiv_by_const.c util: Add and use functions to calculate min and max int for a size 2021-08-03 12:55:02 -07:00
fast_idiv_by_const.h
fast_urem_by_const.h util: Add a helper for faster remainders 2019-05-31 19:14:27 +02:00
format_r11g11b10f.h
format_rgb9e5.h
format_srgb.h
format_srgb.py python: drop python2 support 2021-08-14 21:44:32 +00:00
fossilize_db.c util/fossilize_db: Don't corrupt keys during entry read. 2021-09-04 15:12:06 +02:00
fossilize_db.h util/fossilize_db: Add extra flock mutex. 2021-08-08 13:34:42 +02:00
futex.h util: futex fixes for OpenBSD 2020-08-31 09:14:57 +00:00
half_float.c gallium/util: remove empty file u_half.h 2020-10-06 21:07:11 -04:00
half_float.h util: Add accessor for util_cpu_caps 2021-02-26 18:31:19 +00:00
hash_table.c util/hash_table: Clear special 0/1 entries for u64 hash table too 2021-11-02 11:02:18 -07:00
hash_table.h mesa: skip strlen when hashing strings for ProgramResourceHash 2021-10-29 07:19:20 -04:00
libsync.h util/libsync: Fix timeout handling if poll() wakes up early 2021-11-09 04:05:55 +00:00
list.h util/list: use helper function in list_is_singular 2020-12-18 01:46:00 +00:00
log.c util/log: Add a streaming printf interface. 2021-06-18 18:18:35 +00:00
log.h util/log: Add a streaming printf interface. 2021-06-18 18:18:35 +00:00
macros.h util,gallium: put count in pipe_resource & sampler_view on its own cache line 2021-10-13 03:26:20 +00:00
memstream.c util: Disable memstream for Apple builds 2021-01-08 09:37:14 +00:00
memstream.h util,ac,aco,radv: Cross-platform memstream API 2020-10-19 03:37:42 -07:00
mesa-sha1.c util/mesa_sha1: add helper to reconvert sha1 hex strings 2021-02-21 02:50:45 +00:00
mesa-sha1.h util/mesa_sha1: add helper to reconvert sha1 hex strings 2021-02-21 02:50:45 +00:00
meson.build move util/indices to core util 2021-11-16 14:12:03 +00:00
os_file.c util: replaced ENODATA with ENOATTR for non-Linux systems 2021-06-28 21:12:24 +03:00
os_file.h util: Make os_read_file use O_BINARY on Windows 2021-03-11 23:43:47 +00:00
os_memory.h Fix VMware capitalization. 2020-10-27 15:33:40 -07:00
os_memory_aligned.h util: Add an aligned realloc function 2020-04-21 11:09:03 -07:00
os_memory_debug.h util: move debug_memory_{begin,end} to os_memory_debug.h 2020-02-24 23:07:57 +00:00
os_memory_fd.c util: use anonymous file for memory fd creation 2021-10-27 15:26:52 +00:00
os_memory_fd.h gallium: add utility and interface for memory fd allocations 2021-10-06 13:49:08 +00:00
os_memory_stdc.h gallium: add utility and interface for memory fd allocations 2021-10-06 13:49:08 +00:00
os_misc.c util: Remove unused Android options_tbl_lock 2021-04-15 16:01:21 +00:00
os_misc.h util: Add os_get_page_size query 2020-12-02 10:12:27 -08:00
os_socket.c util: fix possible fd leaks in os_socket_listen_abstract 2020-07-30 10:41:00 +00:00
os_socket.h util/os_socket: fix header unavailable on windows 2020-02-04 17:33:49 +00:00
os_time.c util/os_time: Safe os_time_get_nano for Windows 2020-11-26 07:58:56 +00:00
os_time.h util: Add os_localtime 2020-12-01 07:11:44 +00:00
ralloc.c vulkan: Add vk_asprintf and vk_vasprintf helpers 2021-09-23 21:14:32 +00:00
ralloc.h
rand_xor.c util/rand_xor: extend the urandom path to all non-Windows platforms 2020-05-16 12:05:37 +00:00
rand_xor.h util/rand_xor: make it clear that {,s_}rand_xorshift128plus take *exactly 2* uint64_t 2020-05-16 12:05:37 +00:00
rb_tree.c
rb_tree.h util: Convert rb_tree_test to gtest 2021-10-20 21:40:31 -07:00
register_allocate.c util/ra: Fix deserialization of register sets 2021-11-10 22:57:57 +00:00
register_allocate.h ra: Add fast-path support for register classes of contiguous regs. 2021-06-04 19:08:57 +00:00
register_allocate_internal.h ra: Add fast-path support for register classes of contiguous regs. 2021-06-04 19:08:57 +00:00
rgtc.c
rgtc.h
rounding.h util: When building 'ARM64EC', don't use x64 intrinsics which need to be emulated 2021-01-22 17:56:08 +00:00
rwlock.h util: Fix rwlock Windows include for MinGW 2020-10-20 08:33:42 +00:00
set.c util/set: add macro for destructively iterating set entries 2021-04-07 22:57:27 +00:00
set.h util/set: add macro for destructively iterating set entries 2021-04-07 22:57:27 +00:00
simple_list.h
simple_mtx.h util: Add helgrind support for simple_mtx 2020-11-24 21:03:34 +00:00
slab.c util/slab: use simple_mtx_t 2021-10-05 23:46:14 +00:00
slab.h util/slab: use simple_mtx_t 2021-10-05 23:46:14 +00:00
softfloat.c softfloat: Silence a warning at -Og 2021-02-18 20:59:43 +00:00
softfloat.h util: implement F16C using inline assembly on x86_64 2020-10-06 21:07:03 -04:00
sparse_array.c util/sparse_free_list: manipulate node pointers using atomic primitives 2020-04-18 12:18:03 +00:00
sparse_array.h util/sparse_array: Stash the node level in the node pointer 2020-03-20 15:31:10 -05:00
string_buffer.c util: use standard name for vsnprintf() 2019-07-19 22:39:38 +01:00
string_buffer.h
strndup.h
strtod.c
strtod.h
texcompress_rgtc_tmp.h
timespec.h lavapipe: fix usleep usage in lvp_device 2020-10-27 21:05:55 +00:00
u_atomic.c
u_atomic.h util: Use explicit relaxed reads for u_queue 2021-01-28 18:07:09 +00:00
u_cpu_detect.c util: fix sign comparison 2021-09-30 04:19:27 +00:00
u_cpu_detect.h util/cpu_detect: add/guess support for next Zen CPUs 2021-08-31 22:29:21 +00:00
u_debug.c util: add a env getter for versions 2020-11-11 06:08:15 +10:00
u_debug.h util: Add helper to get FILE* options 2020-12-03 21:19:57 +00:00
u_debug_describe.c util: import u_debug_refcnt, u_hash_table, u_debug_describe from gallium 2021-10-01 14:51:23 +00:00
u_debug_describe.h util: import u_debug_refcnt, u_hash_table, u_debug_describe from gallium 2021-10-01 14:51:23 +00:00
u_debug_memory.c util: move debug_memory_{begin,end} to os_memory_debug.h 2020-02-24 23:07:57 +00:00
u_debug_refcnt.c util: import u_debug_refcnt, u_hash_table, u_debug_describe from gallium 2021-10-01 14:51:23 +00:00
u_debug_refcnt.h util: import u_debug_refcnt, u_hash_table, u_debug_describe from gallium 2021-10-01 14:51:23 +00:00
u_debug_stack.c util: Fix pointer to integer conversion error when using libunwind 2021-01-15 20:00:20 +00:00
u_debug_stack.h gallium/android: Rewrite backtrace helper for android 2020-08-05 18:08:06 +00:00
u_debug_stack_android.cpp gallium/android: Rewrite backtrace helper for android 2020-08-05 18:08:06 +00:00
u_debug_symbol.c util/u_debug_symbol: remove debug_symbol_name_glibc and execinfo dependency 2021-08-26 01:47:30 +00:00
u_debug_symbol.h util: Move stack debug functions to src/util 2020-08-05 18:08:06 +00:00
u_drm.h
u_dynarray.h u_dynarray: turn util_dynarray_{grow, resize} into element-oriented macros 2019-06-12 18:30:25 -04:00
u_endian.h util: unbreak endian detection on OpenBSD 2020-08-31 09:14:57 +00:00
u_fifo.h util/u_trace: make u_trace usable for other than gallium drivers 2021-09-10 14:58:28 +03:00
u_hash_table.c util: import u_debug_refcnt, u_hash_table, u_debug_describe from gallium 2021-10-01 14:51:23 +00:00
u_hash_table.h util: import u_debug_refcnt, u_hash_table, u_debug_describe from gallium 2021-10-01 14:51:23 +00:00
u_idalloc.c util/idalloc: add util_idalloc_alloc_range 2021-07-09 10:05:46 +00:00
u_idalloc.h util/idalloc: add util_idalloc_alloc_range 2021-07-09 10:05:46 +00:00
u_math.c util: Move the 4x4 matrix inverse function to u_math 2021-06-18 22:16:27 +00:00
u_math.h mesa: add LodBias quantization from st/mesa 2021-06-27 10:28:39 -04:00
u_memory.h util,gallium: put count in pipe_resource & sampler_view on its own cache line 2021-10-13 03:26:20 +00:00
u_memset.h util: add optimised memset64 2021-02-22 00:30:46 +00:00
u_mm.c util: don't include p_defines.h and u_pointer.h from gallium 2020-03-27 21:00:10 +00:00
u_mm.h mesa/main/util: moving gallium u_mm to util, remove main/mm 2019-12-02 13:59:28 +01:00
u_perfetto.cc util/perfetto: Add one-time init 2021-05-10 15:34:07 +00:00
u_perfetto.h util/perfetto: Add one-time init 2021-05-10 15:34:07 +00:00
u_printf.cpp vulkan: Add vk_asprintf and vk_vasprintf helpers 2021-09-23 21:14:32 +00:00
u_printf.h vulkan: Add vk_asprintf and vk_vasprintf helpers 2021-09-23 21:14:32 +00:00
u_process.c util: make util_get_process_exec_path work on FreeBSD w/o procfs 2021-10-29 06:06:05 +00:00
u_process.h util/u_process: add util_get_process_exec_path 2020-03-24 08:30:34 +01:00
u_qsort.cpp util: Add qsort_r/s args adapter for MSVC and BSD/macOS 2021-06-24 20:05:12 +00:00
u_qsort.h util: Add qsort_r/s args adapter for MSVC and BSD/macOS 2021-06-24 20:05:12 +00:00
u_queue.c util/queue: fix a data race detected by TSAN when finishing the queue 2021-11-19 09:02:23 +01:00
u_queue.h util/queue: use simple_mtx_t for finish_lock 2021-10-05 23:46:14 +00:00
u_string.h util: fix gcc vsnprintf overflow 2021-02-19 11:05:38 +00:00
u_thread.h util/queue: fix a data race detected by TSAN when finishing the queue 2021-11-19 09:02:23 +01:00
u_vector.c util/vector: make util_vector_init harder to misuse 2021-10-08 00:15:11 +00:00
u_vector.h util/vector: make util_vector_init harder to misuse 2021-10-08 00:15:11 +00:00
vl_rbsp.h util/vl: move gallium vl_vlc.h and vl_rbsp.h to shared code. 2021-11-15 21:57:28 +00:00
vl_vlc.h util/vl: move gallium vl_vlc.h and vl_rbsp.h to shared code. 2021-11-15 21:57:28 +00:00
vma.c util/vma: Add a debug print helper 2020-05-13 23:36:44 +00:00
vma.h util/vma: Add a debug print helper 2020-05-13 23:36:44 +00:00
xmlconfig.c util/xmlconfig: Allow DT_UNKNOWN files 2021-11-09 23:25:32 +00:00
xmlconfig.h driconfig: Add support for device specific config 2021-08-02 16:37:24 -07:00
xxd.py python: drop python2 support 2021-08-14 21:44:32 +00:00
xxhash.h xxhash: update fallthrough comments 2020-12-01 10:04:41 +01:00