Skip to content

Commit e6c2952

Browse files
authored
[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.
1 parent 3358c77 commit e6c2952

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler-rt/lib/scudo/standalone/condition_variable.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ struct ConditionVariableState {
5151

5252
template <typename Config>
5353
struct ConditionVariableState<Config, decltype(Config::UseConditionVariable)> {
54-
static constexpr bool enabled() { return true; }
54+
static constexpr bool enabled() { return Config::UseConditionVariable; }
5555
using ConditionVariableT = typename Config::ConditionVariableT;
5656
};
5757

0 commit comments

Comments
 (0)