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
This commit is contained in:
parent
1b5a90b691
commit
7e54f5ab11
@ -528,14 +528,7 @@ class Thread {
|
||||
virtual ~Thread() {}
|
||||
|
||||
void SetJoinable(bool joinable) {}
|
||||
#if defined(HAVE_PTHREAD)
|
||||
void Start() {
|
||||
pthread_create(&th_, NULL, &Thread::InvokeThread, this);
|
||||
}
|
||||
void Join() {
|
||||
pthread_join(th_, NULL);
|
||||
}
|
||||
#elif defined(OS_WINDOWS) || defined(OS_CYGWIN)
|
||||
#if defined(OS_WINDOWS) || defined(OS_CYGWIN)
|
||||
void Start() {
|
||||
handle_ = CreateThread(NULL,
|
||||
0,
|
||||
@ -548,6 +541,13 @@ class Thread {
|
||||
void Join() {
|
||||
WaitForSingleObject(handle_, INFINITE);
|
||||
}
|
||||
#elif defined(HAVE_PTHREAD)
|
||||
void Start() {
|
||||
pthread_create(&th_, NULL, &Thread::InvokeThread, this);
|
||||
}
|
||||
void Join() {
|
||||
pthread_join(th_, NULL);
|
||||
}
|
||||
#else
|
||||
# error No thread implementation.
|
||||
#endif
|
||||
|
||||
Loading…
Reference in New Issue
Block a user