Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(877)

Side by Side Diff: base/platform_thread_win.cc

Issue 5693003: Consider PlatformThread::Join() to be blocking IO. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comments for shutdown. Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698