| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/platform_thread.h" | 5 #include "base/platform_thread.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/thread_restrictions.h" | 8 #include "base/thread_restrictions.h" |
| 9 #include "base/win/windows_version.h" | 9 #include "base/win/windows_version.h" |
| 10 | 10 |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 } | 118 } |
| 119 | 119 |
| 120 // static | 120 // static |
| 121 bool PlatformThread::CreateNonJoinable(size_t stack_size, Delegate* delegate) { | 121 bool PlatformThread::CreateNonJoinable(size_t stack_size, Delegate* delegate) { |
| 122 return CreateThreadInternal(stack_size, delegate, NULL); | 122 return CreateThreadInternal(stack_size, delegate, NULL); |
| 123 } | 123 } |
| 124 | 124 |
| 125 // static | 125 // static |
| 126 void PlatformThread::Join(PlatformThreadHandle thread_handle) { | 126 void PlatformThread::Join(PlatformThreadHandle thread_handle) { |
| 127 DCHECK(thread_handle); | 127 DCHECK(thread_handle); |
| 128 base::ThreadRestrictions::AssertIOAllowed(); |
| 128 | 129 |
| 129 // Wait for the thread to exit. It should already have terminated but make | 130 // Wait for the thread to exit. It should already have terminated but make |
| 130 // sure this assumption is valid. | 131 // sure this assumption is valid. |
| 131 DWORD result = WaitForSingleObject(thread_handle, INFINITE); | 132 DWORD result = WaitForSingleObject(thread_handle, INFINITE); |
| 132 DCHECK_EQ(WAIT_OBJECT_0, result); | 133 DCHECK_EQ(WAIT_OBJECT_0, result); |
| 133 | 134 |
| 134 CloseHandle(thread_handle); | 135 CloseHandle(thread_handle); |
| 135 } | 136 } |
| OLD | NEW |