Index: src/platform-win32.cc |
diff --git a/src/platform-win32.cc b/src/platform-win32.cc |
index 898a2a3918c3816a2fcee171a2f025f80d2f649f..46af4dcdcd22b126fbaaa528bffbee655a0299ea 100644 |
--- a/src/platform-win32.cc |
+++ b/src/platform-win32.cc |
@@ -1511,6 +1511,7 @@ class Thread::PlatformData : public Malloced { |
public: |
explicit PlatformData(HANDLE thread) : thread_(thread) {} |
HANDLE thread_; |
+ unsigned thread_id_; |
}; |
@@ -1554,13 +1555,15 @@ void Thread::Start() { |
ThreadEntry, |
this, |
0, |
- NULL)); |
+ &data_->thread_id_)); |
} |
// Wait for thread to terminate. |
void Thread::Join() { |
- WaitForSingleObject(data_->thread_, INFINITE); |
+ if (data_->thread_id_ != GetCurrentThreadId()) { |
+ WaitForSingleObject(data_->thread_, INFINITE); |
+ } |
} |