aboutsummaryrefslogtreecommitdiff
path: root/compiler-rt
diff options
context:
space:
mode:
authorChiaHungDuan <chiahungduan@google.com>2024-01-10 11:03:28 -0800
committerGitHub <noreply@github.com>2024-01-10 11:03:28 -0800
commite6c2952eb51a422e17f002d97b0ea467be4d325b (patch)
tree0f26cdd1efdd05fc8b7f87bb3d0ce80607a28314 /compiler-rt
parent3358c77b01fff71c586cc998dd80e06662d9e854 (diff)
downloadllvm-e6c2952eb51a422e17f002d97b0ea467be4d325b.zip
llvm-e6c2952eb51a422e17f002d97b0ea467be4d325b.tar.gz
llvm-e6c2952eb51a422e17f002d97b0ea467be4d325b.tar.bz2
[scudo] Condition variable can be disabled by setting the flag to off (#77532)
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.
Diffstat (limited to 'compiler-rt')
-rw-r--r--compiler-rt/lib/scudo/standalone/condition_variable.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler-rt/lib/scudo/standalone/condition_variable.h b/compiler-rt/lib/scudo/standalone/condition_variable.h
index 549f6e9..4afebdc 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 <typename Config>
struct ConditionVariableState<Config, decltype(Config::UseConditionVariable)> {
- static constexpr bool enabled() { return true; }
+ static constexpr bool enabled() { return Config::UseConditionVariable; }
using ConditionVariableT = typename Config::ConditionVariableT;
};