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 {
|
const char *Name() const {
|
||||||
static std::string name;
|
static thread_local std::string name;
|
||||||
if (has_param_) {
|
if (has_param_) {
|
||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
os << "error";
|
os << "error";
|
||||||
@ -315,7 +315,7 @@ struct EvalTweedieNLogLik {
|
|||||||
<< "tweedie variance power must be in interval [1, 2)";
|
<< "tweedie variance power must be in interval [1, 2)";
|
||||||
}
|
}
|
||||||
const char *Name() const {
|
const char *Name() const {
|
||||||
static std::string name;
|
static thread_local std::string name;
|
||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
os << "tweedie-nloglik@" << rho_;
|
os << "tweedie-nloglik@" << rho_;
|
||||||
name = os.str();
|
name = os.str();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user