Remove xgboost's thread_local and switch to dmlc::ThreadLocalStore (#2121)

* Remove xgboost's own version of thread_local and switch to dmlc::ThreadLocalStore (#2109)

* Update dmlc-core
This commit is contained in:
Huffers
2017-03-27 17:09:18 +01:00
committed by Tianqi Chen
parent 14fba01b5a
commit d45cf240a9
5 changed files with 7 additions and 98 deletions

View File

@@ -4,6 +4,7 @@
#include <xgboost/learner.h>
#include <xgboost/c_api.h>
#include <xgboost/logging.h>
#include <dmlc/thread_local.h>
#include <rabit/rabit.h>
#include <cstdio>
#include <vector>
@@ -13,7 +14,6 @@
#include "./c_api_error.h"
#include "../data/simple_csr_source.h"
#include "../common/thread_local.h"
#include "../common/math.h"
#include "../common/io.h"
#include "../common/group_data.h"
@@ -197,7 +197,7 @@ struct XGBAPIThreadLocalEntry {
};
// define the threadlocal store.
typedef xgboost::common::ThreadLocalStore<XGBAPIThreadLocalEntry> XGBAPIThreadLocalStore;
typedef dmlc::ThreadLocalStore<XGBAPIThreadLocalEntry> XGBAPIThreadLocalStore;
int XGDMatrixCreateFromFile(const char *fname,
int silent,

View File

@@ -3,14 +3,14 @@
* \file c_api_error.cc
* \brief C error handling
*/
#include <dmlc/thread_local.h>
#include "./c_api_error.h"
#include "../common/thread_local.h"
struct XGBAPIErrorEntry {
std::string last_error;
};
typedef xgboost::common::ThreadLocalStore<XGBAPIErrorEntry> XGBAPIErrorStore;
typedef dmlc::ThreadLocalStore<XGBAPIErrorEntry> XGBAPIErrorStore;
const char *XGBGetLastError() {
return XGBAPIErrorStore::Get()->last_error.c_str();