summaryrefslogtreecommitdiffstats
path: root/include/internal/tsan_assist.h
diff options
context:
space:
mode:
authorPauli <pauli@openssl.org>2022-01-12 13:26:38 +1100
committerPauli <pauli@openssl.org>2022-01-13 21:51:48 +1100
commitd1ec05915686019eec8fa8de9890292980fc5d6e (patch)
treef9496f8a7c18a71e23a6922bde28dd33aa2f47b7 /include/internal/tsan_assist.h
parent3517a3e055d3ed27b70441e2ee087fbb709b58da (diff)
tsan: make detecting the need for locking when using tsan easier
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/17479)
Diffstat (limited to 'include/internal/tsan_assist.h')
-rw-r--r--include/internal/tsan_assist.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/internal/tsan_assist.h b/include/internal/tsan_assist.h
index f8285b1d85..37631ab816 100644
--- a/include/internal/tsan_assist.h
+++ b/include/internal/tsan_assist.h
@@ -130,7 +130,13 @@
#ifndef TSAN_QUALIFIER
-# define TSAN_QUALIFIER volatile
+# ifdef OPENSSL_THREADS
+# define TSAN_QUALIFIER volatile
+# define TSAN_REQUIRES_LOCKING
+# else /* OPENSSL_THREADS */
+# define TSAN_QUALIFIER
+# endif /* OPENSSL_THREADS */
+
# define tsan_load(ptr) (*(ptr))
# define tsan_store(ptr, val) (*(ptr) = (val))
# define tsan_counter(ptr) ((*(ptr))++)