From 27e10efa6667aeb62f2dbee508166a5860a9ef09 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Mon, 1 May 2023 16:44:34 -0400 Subject: [PATCH] Use std::atomic as it's necessary for correct thread safety Now that C++11 is required, we can unconditionally use std::atomic in this case, which is more correct. --- modules/core/src/system.cpp | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/modules/core/src/system.cpp b/modules/core/src/system.cpp index d4fdbf05ee..7811ab72f0 100644 --- a/modules/core/src/system.cpp +++ b/modules/core/src/system.cpp @@ -42,6 +42,7 @@ //M*/ #include "precomp.hpp" +#include #include #include @@ -58,18 +59,6 @@ #include #include -#ifndef OPENCV_WITH_THREAD_SANITIZER - #if defined(__clang__) && defined(__has_feature) - #if __has_feature(thread_sanitizer) - #define OPENCV_WITH_THREAD_SANITIZER 1 - #include // assume C++11 - #endif - #endif -#endif -#ifndef OPENCV_WITH_THREAD_SANITIZER - #define OPENCV_WITH_THREAD_SANITIZER 0 -#endif - namespace cv { static void _initSystem() @@ -1539,11 +1528,7 @@ private: #endif #else // _WIN32 pthread_key_t tlsKey; -#if OPENCV_WITH_THREAD_SANITIZER std::atomic disposed; -#else - bool disposed; -#endif #endif };