From 6c4f87a6b42cfaa4b092e558fd8240c37c9cf137 Mon Sep 17 00:00:00 2001 From: Chia-hung Duan Date: Tue, 9 Jan 2024 22:09:15 +0000 Subject: [PATCH] [scudo] Condition variable can be disabled by setting the flag to off To enable the condition variable, you have to define both UseConditionVariable and the ConditionVariableT. Otherwise, it'll be disabled. However, you may want to disable the condition variable by setting UseConditionVariable=false, for example, while measuring the performance and you want to turn it off temporarily. Instead of requiring the removal of the variable, examining its value makes more sense. --- compiler-rt/lib/scudo/standalone/condition_variable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler-rt/lib/scudo/standalone/condition_variable.h b/compiler-rt/lib/scudo/standalone/condition_variable.h index 549f6e9f787ba..4afebdc9d04c2 100644 --- a/compiler-rt/lib/scudo/standalone/condition_variable.h +++ b/compiler-rt/lib/scudo/standalone/condition_variable.h @@ -51,7 +51,7 @@ struct ConditionVariableState { template struct ConditionVariableState { - static constexpr bool enabled() { return true; } + static constexpr bool enabled() { return Config::UseConditionVariable; } using ConditionVariableT = typename Config::ConditionVariableT; };