summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPauli <pauli@openssl.org>2022-01-12 13:26:38 +1100
committerPauli <pauli@openssl.org>2022-01-13 21:46:34 +1100
commite22cbe5e67461470590e6fb8858c95285fcdea0e (patch)
treee5e275c29de5391478b8f40c9ffd5215a1b061de /include
parent1fc97807d3a3b5e3065a7df80d1ad3601ccc5e2f (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')
-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 c67c591e0e..512bfe4be9 100644
--- a/include/internal/tsan_assist.h
+++ b/include/internal/tsan_assist.h
@@ -125,7 +125,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_add(ptr, n) (*(ptr) += (n))