From: Pauli Date: Wed, 12 Jan 2022 02:26:38 +0000 (+1100) Subject: tsan: make detecting the need for locking when using tsan easier X-Git-Tag: openssl-3.2.0-alpha1~3084 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e22cbe5e67461470590e6fb8858c95285fcdea0e;p=thirdparty%2Fopenssl.git tsan: make detecting the need for locking when using tsan easier Reviewed-by: Bernd Edlinger (Merged from https://github.com/openssl/openssl/pull/17479) --- diff --git a/include/internal/tsan_assist.h b/include/internal/tsan_assist.h index c67c591e0ee..512bfe4be9e 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))