From a161bafa5f0e3ca00592135480f97a35aaa95940 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Mon, 13 Apr 2020 09:38:36 +0200 Subject: [PATCH] Fix #6066, #6045: Disable spincount by default. --- winpr/CMakeLists.txt | 4 ++++ winpr/include/winpr/synch.h | 8 -------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/winpr/CMakeLists.txt b/winpr/CMakeLists.txt index 8c945b081..05e662885 100644 --- a/winpr/CMakeLists.txt +++ b/winpr/CMakeLists.txt @@ -46,6 +46,10 @@ include(CheckCCompilerFlag) include(GNUInstallDirsWrapper) include(CMakePackageConfigHelpers) +if (NOT WIN32) + add_definitions(-DWINPR_CRITICAL_SECTION_DISABLE_SPINCOUNT) +endif() + # Soname versioning set(RAW_VERSION_STRING "3.0.0-dev") if(EXISTS "${CMAKE_SOURCE_DIR}/.source_tag") diff --git a/winpr/include/winpr/synch.h b/winpr/include/winpr/synch.h index 984fafdf6..4c75b17ae 100644 --- a/winpr/include/winpr/synch.h +++ b/winpr/include/winpr/synch.h @@ -125,14 +125,6 @@ extern "C" /* Critical Section */ -#if defined(__linux__) -/** - * Linux NPTL thread synchronization primitives are implemented using - * the futex system calls ... we can't beat futex with a spin loop. - */ -#define WINPR_CRITICAL_SECTION_DISABLE_SPINCOUNT -#endif - typedef struct _RTL_CRITICAL_SECTION { PVOID DebugInfo;