Fix race condition in cpp metric tests. (#9058)
This commit is contained in:
parent
a5cd2412de
commit
b908680bec
@ -217,7 +217,7 @@ struct EvalError {
|
||||
}
|
||||
}
|
||||
const char *Name() const {
|
||||
static std::string name;
|
||||
static thread_local std::string name;
|
||||
if (has_param_) {
|
||||
std::ostringstream os;
|
||||
os << "error";
|
||||
@ -315,7 +315,7 @@ struct EvalTweedieNLogLik {
|
||||
<< "tweedie variance power must be in interval [1, 2)";
|
||||
}
|
||||
const char *Name() const {
|
||||
static std::string name;
|
||||
static thread_local std::string name;
|
||||
std::ostringstream os;
|
||||
os << "tweedie-nloglik@" << rho_;
|
||||
name = os.str();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user