]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
tsan: make detecting the need for locking when using tsan easier
authorPauli <pauli@openssl.org>
Wed, 12 Jan 2022 02:26:38 +0000 (13:26 +1100)
committerPauli <pauli@openssl.org>
Thu, 13 Jan 2022 10:46:34 +0000 (21:46 +1100)
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/17479)

include/internal/tsan_assist.h

index c67c591e0eeaf437ddf4ed06f78b085d15851109..512bfe4be9e41774689d24dcfc90ce45af66e67f 100644 (file)
 
 #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))