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,
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