some strict cxx98 check

This commit is contained in:
tqchen
2015-04-27 17:37:07 -07:00
parent 48bcc021f7
commit 279758a92e
6 changed files with 14 additions and 6 deletions

View File

@@ -55,8 +55,10 @@ inline void ThreadExit(void *status) {
} // namespace xgboost
#else
// thread interface using g++
extern "C" {
#include <semaphore.h>
#include <pthread.h>
}
namespace xgboost {
namespace utils {
/*!\brief semaphore class */
@@ -120,6 +122,7 @@ class Semaphore {
}
#endif
};
/*!\brief simple thread class */
class Thread {
private:
@@ -130,7 +133,7 @@ class Thread {
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
pthread_create(&thread, &attr, entry, param);
}
}
inline int Join(void) {
void *status;
return pthread_join(thread, &status);

View File

@@ -31,7 +31,8 @@ class ThreadBuffer {
}
/*!\brief set parameter, will also pass the parameter to factory */
inline void SetParam(const char *name, const char *val) {
if (!std::strcmp( name, "buffer_size")) buf_size = atoi(val);
using namespace std;
if (!strcmp( name, "buffer_size")) buf_size = atoi(val);
factory.SetParam(name, val);
}
/*!