From af8a2f5612bb0f354f35a20d87352d707c5ead88 Mon Sep 17 00:00:00 2001 From: Zhao Zhili Date: Tue, 13 Apr 2021 21:03:32 +0800 Subject: [PATCH] Fix thread safety of CUDT::uglobal() when C++11 is unavailable --- srtcore/core.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/srtcore/core.cpp b/srtcore/core.cpp index 09aaf4ca88..61f27517f5 100644 --- a/srtcore/core.cpp +++ b/srtcore/core.cpp @@ -57,7 +57,7 @@ modified by #include #endif -#if !HAVE_FULL_CXX11 +#if !HAVE_CXX11 // for pthread_once #include #endif @@ -216,7 +216,7 @@ struct SrtOptionAction } srt_options_action; -#if HAVE_FULL_CXX11 +#if HAVE_CXX11 CUDTUnited* CUDT::uglobal() { @@ -224,7 +224,7 @@ CUDTUnited* CUDT::uglobal() return &instance; } -#else // !HAVE_FULL_CXX11 +#else // !HAVE_CXX11 static pthread_once_t s_UDTUnitedOnce = PTHREAD_ONCE_INIT; static CUDTUnited* s_UDTUnited = NULL;