From d20c9bde7e427962edd824deae7d63f629d8d871 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Mon, 4 Oct 2021 09:40:16 +0000 Subject: [PATCH] core(TLS): force TlsAbstraction initialization before main() --- modules/core/src/system.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/core/src/system.cpp b/modules/core/src/system.cpp index df9e8a0ce7..e2284b0415 100644 --- a/modules/core/src/system.cpp +++ b/modules/core/src/system.cpp @@ -1834,6 +1834,12 @@ static void WINAPI opencv_fls_destructor(void* pData) #endif // CV_USE_FLS #endif // _WIN32 +static TlsAbstraction* const g_force_initialization_of_TlsAbstraction +#if defined __GNUC__ + __attribute__((unused)) +#endif + = getTlsAbstraction(); + } // namespace details using namespace details;