Commit 7e54f5ab authored by 's avatar

Make the order of check for OS_WINDOWS|OS_CYGWIN and HAVE_PTHREAD consistent.


git-svn-id: https://google-glog.googlecode.com/svn/trunk@70 eb4d4688-79bd-11dd-afb4-1d65580434c0
parent 1b5a90b6
...@@ -528,14 +528,7 @@ class Thread { ...@@ -528,14 +528,7 @@ class Thread {
virtual ~Thread() {} virtual ~Thread() {}
void SetJoinable(bool joinable) {} void SetJoinable(bool joinable) {}
#if defined(HAVE_PTHREAD) #if defined(OS_WINDOWS) || defined(OS_CYGWIN)
void Start() {
pthread_create(&th_, NULL, &Thread::InvokeThread, this);
}
void Join() {
pthread_join(th_, NULL);
}
#elif defined(OS_WINDOWS) || defined(OS_CYGWIN)
void Start() { void Start() {
handle_ = CreateThread(NULL, handle_ = CreateThread(NULL,
0, 0,
...@@ -548,6 +541,13 @@ class Thread { ...@@ -548,6 +541,13 @@ class Thread {
void Join() { void Join() {
WaitForSingleObject(handle_, INFINITE); WaitForSingleObject(handle_, INFINITE);
} }
#elif defined(HAVE_PTHREAD)
void Start() {
pthread_create(&th_, NULL, &Thread::InvokeThread, this);
}
void Join() {
pthread_join(th_, NULL);
}
#else #else
# error No thread implementation. # error No thread implementation.
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment